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.

Will Restoring an Account Backup Delete Other Databases?

Discussion in 'Database Discussions' started by thetzfreak, Jul 8, 2012.

  1. thetzfreak

    thetzfreak Registered

    Sep 19, 2010
    Likes Received:
    Trophy Points:
    Long story short: I have many accounts in WHM, many domains. However, most of the MySQL databases were created under one user, "admin" (let's say it's I recently moved the account to another web server , and now I need to move it back. I would like to restore this account from a backup made by that web server. However, it only has 3 databases attached to that domain, while the server I'm moving it to has those 3 databases (old dbs that need to be replaced), PLUS all the other databases which are used by other accounts on the server.

    My question: if I restore the account, will it delete all the other databases on the account, or will it only replace the 3 DBs it has? I can't take any chances here to delete all those other DBs...

    If it WOULD delete all those other accounts, how would I go about restoring this account without losing the other data? An easy to way to resolve this situation would be to move the mysql owners to the proper accounts, but alas it doesn't seem that there is a way to do that via WHM.

    Any advice? Thanks.
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Oct 2, 2010
    Likes Received:
    Trophy Points:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator

    Because the databases would be associated with the admin account, the account will fail to restore to the server due to the duplication. You'll have to drop the databases and account anyway on that old machine. You would want to make a backup of the databases before doing so:

    mysqldump --add-drop-table dbname > /home/dbname.sql
    Please replace dbname with the name of the database being backed up.

    To restore the database afterward, you could do:

    mysql dbname < /home/dbname.sql
    Again, please replace dbname with the name of the database.


Share This Page