Importing Site Members - Passwords not working

Permalink
I am updating a website using a different theme and the latest version of C5. The old site has members who regularly log into the site. There are over 1500 members. At the moment I have the old site operating under its normal url and the new site operating in a testing location. I have imported the 1500 users by manually exporting the database tables users, groups and usergroups from the old site and importing that data into the new one. Because the user passwords are encrypted I notice that when imported into the new version of the site the password cannot be successfully entered. Is there a solution to this. I do not want to have to get all users to re-enter their information again and the new site cannot go live until I resolve this.

Regards Ian

ianj
 
FernandoCordeiro replied on at Permalink Best Answer Reply
FernandoCordeiro
It won't work because of the Password Salt etc.

Basically there's a file that holds some info on how to "understand" the passwords.


Open this file for the old AND the new C5 Installation:

config/site.php



There you probably have something similar to this:

define('DB_SERVER', '<ServerName>');
define('DB_USERNAME', '<UserNameForTheDatabase>');
define('DB_PASSWORD', '<Unintelligible encrypted password>');
define('DB_DATABASE', '<DatabaseName>');
define('BASE_URL', '<YourSiteURL>');
define('DIR_REL', '<Probably nothing>');
define('PASSWORD_SALT', '<Unintelligible lot of characters>');?>
<?php define('DIRNAME_APP_UPDATED', '<Your C5 Version>');?>




The Password_Salt is what's messing with you. If you move you will breav every password that currently works, but there's an easy way to do that.
I suggest 4 easy steps:

1 - Find a password you know in the old Database, and copy it.

2 - Backup the site.php file, then swap the PASSWORD_SALT for the one from the original installation (Maintain backup copies of BOTH);

3 - Backup BOT databases. Then, and only then, move the database;

4 - Just so you can still access the site, paste your old password back where it should be.

Done. :D
ianj replied on at Permalink Reply
ianj
Thanks Fernando,

I figured it had to be the SALT but I just needed confirmation. It seems to be working fine now.

Regards

Ian