Issues with migrating and restoring

Im trying to restore a 4.2.1 backup from a Windows server installation to ubuntu trusty. I used the script provided (openemr/contrib/util/restore) and it seems to be successful. But when I try logging in I get the following error:

[Sat Feb 24 15:17:05.165004 2018] [:error] [pid 20102] [client xxx.xx.xx.xxx:32144] PHP Fatal error: Cannot redeclare password_hash() in /var/www/openemr/library/authentication/password_hashing.php on line 104, referer: http://foobar/interface/login/login.php

I’ve tried reseting the admin creds with the below:
update users_secure set password = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu’ , salt = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$’ where id = ‘1’;

But still no luck. Any ideas?

Thanks!

Sorry I think it’s version 4.1.2 not 4.2.1:

mysql> select * from version;
±--------±--------±--------±------------±------±-----------±------+
| v_major | v_minor | v_patch | v_realpatch | v_tag | v_database | v_acl |
±--------±--------±--------±------------±------±-----------±------+
| 4 | 1 | 2 | 0 | | 97 | 2 |
±--------±--------±--------±------------±------±-----------±------+
1 row in set (0.00 sec)

hi @henryjustinserrano, you’ll want to patch 4.1.2 up to patch 7 so that the password_hash function in library/authentication/password_hashing.php is renamed,
https://www.open-emr.org/wiki/index.php/Old_Outdated_OpenEMR_Patches#4.1.2_Patch_.286.2F19.2F2014.29

1 Like

That fixed it! Thank you so much!