Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Restore backups/import without MySQL resetting mysql passwords?

Discussion in 'Data Protection' started by postcd, Aug 30, 2017.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    689
    Likes Received:
    14
    Trophy Points:
    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:

    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    689
    Likes Received:
    14
    Trophy Points:
    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.
     
    #3 postcd, Mar 20, 2018
    Last edited: Mar 20, 2018
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  5. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    689
    Likes Received:
    14
    Trophy Points:
    68
    Can anyone write what are these commands and how to automate it on cpanel server?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page