3

Is it possible to copy a user from one WordPress site to another?

I copied the record from the user table and all the related records from the usermeta table (12 records by default) but I think something else is needed. I get this message upon login: You do not have sufficient permissions to access this page.

The reason I need this is I have 4 users I'd like to grant access to on a new site but use their credentials from the current site.

9
  • does this include their password?
    – Tom J Nowell
    Commented Apr 4, 2014 at 18:42
  • For 4 users, you'd be better off just creating new accounts for them. There's more to migrating users than just the user records.
    – vancoder
    Commented Apr 4, 2014 at 18:43
  • Yes, @TomJNowell, I'd like to keep their passwords.
    – Nelu
    Commented Apr 4, 2014 at 20:11
  • @vancoder, thanks. I guess I'll have to recreate them then and set new passwords. I am looking into implementing Active Directory, but would still like to know how to migrate a number of users, for future reference.
    – Nelu
    Commented Apr 4, 2014 at 20:12
  • 4
    They won't be able to keep their passwords unless you have the same keys and salts in wp-config.php, changing them would invalidate all of your existing users passwords. I would strongly recommend against this for security reasons, if your client demands it then your client is being unreasonable and should be told no point blank. Tell them it is not possible
    – Tom J Nowell
    Commented Apr 4, 2014 at 21:46

1 Answer 1

2

You need to make sure the new ID of the user in the user table matches the foreign key in the usermeta.

Also a word of caution regarding your comment on Active Directory integration. For public facing websites be extremely careful, you could inadvertantly expose you domain controller information to the web. You might want to consider additional security precautions around the login and admin pages, for example limiting access to certain IP addresses or dual authentication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.