1

So I am currently building a new Wordpress site that has a functionality where users can login and create a business listing for themselves. All of these users are currently using another site of the clients to perform other business aspects.

We are looking at bringing all the sites together in time.

Right now though, I have a user table on the existing site that has login details (username, display name and password among others). I want to grab these details including the MD5 hashed password field and import it into the Wordpress users table?

Is this even possible?

Thanks, A

2
  • you want to move only users or complete database ?? Feb 12, 2014 at 13:40
  • @AjithRNair just the users... the sites are completely separate in what they do Feb 12, 2014 at 13:47

2 Answers 2

1

It seems most of the data is transferable, you'll need a script or something to make sure all the data from your other website is inserted the right way in your wp_users and wp_usermeta table.

All data you want to save extra for users, can be inserted in the wp_usermeta table as key-value pair.

To make sure users can login into the new WordPress site : This is possible if you set your security in WordPress using MD5 hash only without using a salt.

You can do this by overwriting wordpress's wp_hash_password() method.

But you are better of letting existing users change their PW, because MD5 is really insecure.

1

I have managed to find a way to do this. It may be a little backwards, and please correct me if I have this entirely wrong.

I grabbed a SQL dump from the old database using phpMyAdmin of the fields that I needed. I edited the SQL file and adjusted the field names to correlate with the Worpress wp_users table. Then in the new database I used an INSERT INTO command to create the new users.

In Wordpress I then had to assign all the new users a role.

It took the MD5 hashed password and stored it initially in the DB but on the first login it changed the encryption to phpass.

Hope this helps anyone else looking.

A

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.