WordPress.org

Ready to get started?Download WordPress

Forums

Import Users from CSV
[resolved] [closed] Import Existing Users with Multisite (21 posts)

  1. nityac
    Member
    Posted 2 years ago #

    I have seven sites set up in a Multisite scenario. If I use the plugin to import users to Blog 1, when I try to use the CSV file to import an overlapping batch of users across Blogs 2 - 7 it says, "No user was successfully imported."

    Is it possible for me to just import the usernames? If so, how? I don't need to reset passwords or emails every time, just need to get sometimes overlapping batches of users added.

    http://wordpress.org/extend/plugins/import-users-from-csv/

  2. Are you trying to import them per site or on the Network Users page?

    The plugin may not be multisite capable.

  3. nityac
    Member
    Posted 2 years ago #

    Trying to add them per site. I'd be game to add them to the network users page, though. Is there a plug-in you know of that would allow me to assign users across Blogs 1 - 7 after I've added them to network users?

    The thoughts of typing out some 800 users per blog makes me want to cry.

  4. Assign all of them the same role to all sites?

    That is everyone is a ...

    subscriber on Blog 1
    editor on Blog 2
    Admin on Blog 3
    subscriber on Blog 4

    etc etc?

    Because THAT, yes.
    * http://wordpress.org/extend/plugins/multisite-user-management/

  5. Ulrich Sossou
    Member
    Plugin Author

    Posted 2 years ago #

    Well, it is not optimized for use on a multisite. Since the users already exist in the database, they will not be added again.

    But there is a solution.
    If you add fields like 'wp_5_capabilities' with the value 'a:1:{s:10:"subscriber";s:1:"1";}' e.g. in your csv file the user will be added to the corresponding blogs.
    My example will give the user the role subscriber for the blog which ID is 5. Just add one field per blog, so wp_3_capabilities, wp_20_capabilities, etc.

  6. Since the users already exist in the database, they will not be added again.

    Wait ... what? *rereading*

    If I use the plugin to import users to Blog 1, when I try to use the CSV file to import an overlapping batch of users across Blogs 2 - 7 it says, "No user was successfully imported."

    OH! OH OH!

    Duh. I'm an idiot. Sorry.

    Get http://wordpress.org/extend/plugins/multisite-user-management/

    That will let you add them as subscribers to all sites.

  7. nityac
    Member
    Posted 2 years ago #

    Thanks so much for the feedback.

    Ulrich, I'm about to attempt what you've outlined: if that's the case, where can I do the CSV import from? Any of the blogs?

  8. nityac
    Member
    Posted 2 years ago #

    Actually, just tried this and it did the trick.

    HOORAY! Thank you, Ulrich. No tears over adding 800 users x 7 blogs.

  9. nityac
    Member
    Posted 2 years ago #

    One last question: I just added a CSV of users to a particular blog. The blog is showing that there are (2) editors, but not listing the editors I added. (The whole section is just blank.)

    Additionally, the users DO show up in the network admin.

    Any thoughts?

  10. Ulrich Sossou
    Member
    Plugin Author

    Posted 2 years ago #

    @Ipstenu: No problem!

    @nityac: what value did you use to add the editors?
    'a:1:{s:6:"editor";s:1:"1";}'?

  11. nityac
    Member
    Posted 2 years ago #

    Thanks, Ulrich.

    Not to be totally stupid here but: is that a string I need to add somewhere in the code for the blog or a string I need to add to the CSV file?

    I added a column 'wp_5_capabilities' and set everyone in that column to 'Author' via text.

    Thanks,
    Nitya

  12. The s:6 in that bit is string length.

    If you add them as author, it should be the same though...

  13. Ulrich Sossou
    Member
    Plugin Author

    Posted 2 years ago #

    You should set the column content to 'a:1:{s:6:"editor";s:1:"1";}' instead of 'Author'.

    And , as Ipstenu wrote, s:6 bit is a string length (the length of the string 'editor' is 6). So, for subscribers, you would set it to 'a:1:{s:10:"subscriber";s:1:"1";}'.

  14. mrmjct
    Member
    Posted 2 years ago #

    Hi there, I really like the plugin but I'm also having trouble batch uploading users to a WP network.

    I am trying to upload a number of users as subscribers to one blog only on a network install.

    Going to the dashboard for the blog in question, I tried uploading the following test CSV:

    user_login,user_email,user_pass,first_name,last_name,role
    username,fnsn@gmail.com,pass,Fn,Sn,'a:1:{s:10:"subscriber";s:1:"1";}'

    This does appear to create a user:

    • the subscriber count for that blog shows (1)
    • I can also log in with that user's details

    But

    • the username does not appear in the list of all users (or of subscribers) for that blog.
    • and that user cannot access their profile to change it.

    Any ideas what I'm doing wrong?

    Thanks

    Matthew

  15. Ulrich Sossou
    Member
    Plugin Author

    Posted 2 years ago #

    @mrmjct: You should name the role field 'wp_5_capabilities' instead of 'role'. where 5 is the blog_id. So 'wp_10_capabilities' if the blog_id is 10.

  16. mrmjct
    Member
    Posted 2 years ago #

    Thanks Ulrich. My mistake - you had mentioned that in this list that's fixed it now.

  17. bluesalman
    Member
    Posted 2 years ago #

    I have imported some users and their posts/files to 1 of my blog in mulltisite setup, it asked to assign users posts to existing users or import the original users plus the posts, i selected second with the option of download attachments. Users were assigned new roles, that we need change manually. Fine, my question is did this import send any email to user after creation of this new user account?

  18. No, it did not send emails. Next time, though, please make your OWN topic. Posting in an older, resolved, topic is bad form :)

  19. bluesalman
    Member
    Posted 2 years ago #

    Sorry for that:) and thanks for your answer.

  20. baldure
    Member
    Posted 2 years ago #

    I'm having trouble importing users into a multisite setup.

    I'm trying to set the value 'a:1:{s:10:"subscriber";s:1:"1";}' into 'wp_2_capabilities', but it always gets mangled in the database.
    I've tried various combinationsof quotes; no quotes, quotes escaped with '\' and with anoter doublequote, as stated in RFC4180.
    I can correct it in in my development database and make it work, but I don't have the same access to the production database.

    Any ideas?

    Best regards
    Baldur

  21. baldure - Make your own topic.

    Guys, when a topic is RESOLVED and you are NOT the original poster, it's best to make your own topic.

    Closing this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic