Restore backups/import without MySQL resetting mysql passwords?

postcd

Well-Known Member
Oct 22, 2010
717
19
68
I am sorry if it is somewhere documented in a noob friendly way, but i can not find it, found a few technical articles which i do not understand.

My target is very simple.

Yesterday i installed WHM and i have Mysql version: 5.6.37, i changed nothing about mysql. My previous WHM server (on which i made cpanel full backups) has version 5.5.57-cll

Now during restore (WHM/Backup/Backup Restoration) it says:

Warning: The system changed the password for the database user “
mycpanelname
_user” to a random string because the original password used an old and insecure format that is incompatible with MySQL version (5.6.37). You must manually change the password for “bulterie_user” to match the original password in order to ensure that applications that use the credentials will continue to function.
The system changed the password for the database user “mycpanelname_user” to a random string because the original password used an old and insecure format that is incompatible with MySQL version (5.6.37). You must manually change the password for “mycpanelname_user” to match the original password in order to ensure that applications that use the credentials will continue to function.
The system will rename the unmanaged database user “mycpanelname_user” to “bulterie_user2”.
Please which commands to execute on my new server so Backup restorations does not complain about bad passwords and mainly do not change the passwords during restoration?

If i need to upgrade/downgrade mysql, then how exactly please, i do not have any special needs, what i just need is that restored cpanel accounts works and the mysql passwords are not changed. Or if change is necessary then any script or command that would sync mysql pwds with pwds in files.

Moreover i have many cpanel accounts and i found no way to restore full backups in a few clicks, I have to click maybe 600 times.

I restored full abckups, but mysql user passwords was resetted (randomized as above seen) and now i need to somehow replace mysql data by ones in abckups and without mysql passwords be reseted for users.

i already have all-databases.sql file which i can import, but unsure if that will work and be compatible with files. I am quite stuck and my all sites are down now.

Please kindly give me commands or exact steps to solve this. I do not understand technical things. Thank you very much.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Thank you, i see in WHM, Tweak Settings i have "Use pre-4.1-style MySQL® passwords" set to Off.

Here is said: "In cPanel & WHM version 11.44.1.12 and later, if you have the Tweak Setting Use pre-4.1-style MySQL® passwords enabled and then update MySQL to 5.6 or later, you will see a warning similar to the following:

Code:
The system changed the password for the database user "myzom" to a random string because the original password used an old and insecure format that is incompatible with MySQL version 5.6.17. You must manually change the password for "myzom" to match the original password in order to ensure that applications that use the credentials will continue to function
"

But i assume it is not correct, because that WHM option will not probably have any impact on old passwords setup many years ago, so i assume when i move my accounts to server with new MySQL (Version 70 brings support for MySQL 5.7), it will still reset the passwords no matter if i have that option enabled/disabled.

Maybe one can create a script to list all mysql users, find .php files that contain that mysql username and also phrase: "localhost" or 'localhost'
manually read and copy old password
Do password generating/reset command for the username
Do search and replace command in files to replace old copied password by new password.
 
Last edited: