Databases: Exporting/Importing users sql to/from another stie

Databases: Exporting/Importing users sql to/from another stie

by tleubek zakirov -
Number of replies: 5

Hello, everyone

Can you please help with the follwing issue:

I have a website and some registered users on it.

Now I am setting up another site and wanted the users from my first site to be able to enter it with the passwords from my first site.

I did the following:

1)Selected users (created for testing) in the sql (through phpMyAdmin) and exported it.

2) Opened the exported sql with notepad++ to correct the id numbers, so that they dont conflict with existing users.

3) Successfully imported the sql. As Admin I see the users show up the lists of users, but when the imported users try to enter the web site with the passwords from old website it wont let them in.

Could someone please tell me what the problem could be?

Best regards,

Tleubek Zakirov

Average of ratings: -
In reply to tleubek zakirov

Re: Databases: Exporting/Importing users sql to/from another stie

by james mergenthaler -

Your best bet may be to update the passwords for the accounts you imported to something like changeme.  While updating each account password to changeme, also update the setting to require the password to be changed upon initial login.

I have done a similiar process and when editing the exported file, changed the passwords their en mass, to avoid having to edit them all individually.

There is a topic Importing users from another site in this password salting document that may help to keep those passwords, but I had trouble with it, and punted to the aformentioned solution.

Best of luck.

In reply to james mergenthaler

Re: Databases: Exporting/Importing users sql to/from another stie

by tleubek zakirov -

Dear James!

Thank you very much! I tried the password salting instructions and it worked! 

Best regards,

Tleubek Zakirov

In reply to tleubek zakirov

Re: Databases: Exporting/Importing users sql to/from another stie

by james mergenthaler -

tleubek, did you copy the salt from the old config.php file into the new one?

site a config.php

$CFG->passwordsaltmain = 'site a salt string...';

site b config.php

$CFG->passwordsaltmain = 'site b salt string...';

$CFG->passwordsaltmain = 'site a salt string...';

How did you *move the user records from site a to site b?  I tried creating a CSV from site a  and imported into site b, including just the email, username, password, firstname and lastname.

The CSV file imported fine into site b and i even updated the confirmed value to 1 for the records imported into site b, copied the salt from site a to site b, but still not able to log into site b using migrated accounts.  I had to reset the passwords....

In reply to james mergenthaler

Re: Databases: Exporting/Importing users sql to/from another stie

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi,
just for the record, in site b config.php you should read:

$CFG->passwordsaltmain = 'site b salt string...';
$CFG->passwordsaltalt1 = 'site a salt string...';

More in Importing users from other site.

HTH,
Matteo

In reply to james mergenthaler

Re: Databases: Exporting/Importing users sql to/from another stie

by tleubek zakirov -

I copied the salt from old to new site and added to look like this:

$CFG->passwordsaltmain = 'site b salt string...';

$CFG->passwordsaltalt1 = 'site a salt string...';

Export and import I did through phpmyadminin the Cpanel, I chose the sql format and edited the ID numbers in the notepad ++ .

Worked from the first attempt.

Best regards,

Tleubek Zakirov