[Solved] Migrating users to a new site

jmbjmb
edited December 2015 in Newsletter plugin

I need to manually add WP users as part of a site migration. After adding them I would like to have each one saved as a newsletter subscriber and subscribed to a default mailing list. What would be the best way to accomplish this? There are thousands of users so manually using the wp-admin Add Subscriber screen is not an option (in other words, I need a coding solution).

Comments

  • 9 Comments sorted by
  • Vote Up0Vote Down

    @jmb

    Thank you for your message.

    You can use the WP auto import function to auto import your WordPress users as subscribers

    Newsletter>Configuration-System - Auto Import Users http://tribulant.com/docs/wordpress-mailing-list-plugin/6793 ;

    Regards

    Marietha

  • Vote Up0Vote Down

    Thanks. Actually, I didn't mention it, but my needs are more complex. I actually have two different newsletters and the users I am migrating are already subscribed to one or both of them. I will be using the WordPress wp_insert_user and update_user_meta functions to import each user from the original DB but will then need to register them for the relevant newsletter(s) that they already subscribed to on my original site. Also, as these member are already opted-in, I do not want to have them bothered with any kind of confirmation emails. Any ideas for accomplishing this? Thanks.

  • Vote Up0Vote Down

    @jmb

    Would it be possible to import these subscribers manually with a csv file? 

    Regards

    Marietha

  • Vote Up0Vote Down

    Possible, yes, but that is not the way I want to go for various reasons. Also, as I mentioned in another thread I started about mandatory and optional list being possible at signup (http://tribulant.com/forums/discussion/2158/mandatory-and-optional-list-at-signup-possible#Item_3), I want to let members have one list as an option on registration but automatically be registered to a default mailing list. This is not currently possible, so I will need a programmatic way to do this upon successful registration. Thus, finding a coding solution will solve both my issues whereas importing via CSV will not. Hopefully that makes some sense. I am not opposed to writing a function to manually manipulate the DB directly but (1) I am hoping a better method already exists and (2) if a better way does not exist, I would like to make sure that I don't neglect any necessary DB entries (e.g., is there a subscriber count that would need to be incremented or is that calculated real-time in the admin section?). 

  • Vote Up0Vote Down

    So, I finally figured out the code necessary. It turns out, as I suspected, you already offer a way to do this. I found the following (http://tribulant.com/docs/wordpress-mailing-list-plugin/3433) in your Codex. [Side note: disappointed that I posted twice asking for this information with no response...]

    But, I do have a question. The code works just fine and I seem to be getting my test newsletters, but if I examine the wpmlsubscribers table, I see the following fields:

    authinprog

    authkey

    cookieauth

    The firs is set to Y and the other two have hashed values in them. If I add a subscriber manually via the admin interface, these are all blank. So, what does this actually mean and do I need to worry about it at all (e.g., by modifying the $data array)? Please advise.

  • Vote Up0Vote Down

    @jmb

    Thank you for your response.

    And sorry for not getting back to you quicker on this.

    I'm glad to hear that you managed with the code.

    No, you don't need to worry about those fields.

    They are specifically used for when a subscriber authenticates via the Manage Subscriptions interface.

    Let me know if you have other questions that I can assist you with, please.

  • Vote Up0Vote Down

    By the way, I wanted to mark this as [Solved] but it says I don't have permission to edit.

  • Vote Up0Vote Down

    @jmb

    You're welcome, I'm glad that I could assist you.

    I see that the [Solved] tag was added.

Sign In or Register to comment.