Skip to main content

The database cannot be restored

Comments

2 comments

  • rbairwell

    That's odd, I would have expected an error to be thrown if there was a problem.

    I assume you are using WHM's "Backup->Backup Restoration" option and you are ensuring the option "Restore MySQL" is selected.

    If you SSH into the server and go to your backups folder (default /backups/), select the appropriate date folder from where you are restoring from do:

    tar -tzvf <account name>.tar.gz | grep "/mysql/"

    do you see lines such as:

    drwx------ root/root         0 2024-01-04 02:06 <accountname>/mysql/
    -rw------- root/root      1346 2024-01-04 02:06 <accountname>/mysql/<databasename>.create
    -rw-r--r-- root/root 233191875 2024-01-04 02:06 <accountname>/mysql/<databasename>.sql

    with appropriate looking file sizes (3rd column)? If not, the account backups did not include the SQL data (under Backup->Backup Configuration->Databases neither the "Per account" or "Per account and Entire MySQL directory" is selected).

    If they do exist, then it's the restoration that is failing which is more puzzling given the few logs generated... If you can confirm if you do or don't see those files it'll be helpful.

    If you had the "Entire MySQL Directory" selected for Backups, then /backups/<date>/system/dirs/_var_lib_mysql_.tar.gz will contain the database files. You can only use these files (safely) to entirely replace the existing MySQL databases - you'll need to stop MySQL, move the existing /var/lib/mysql files elsewhere (for safety/backup), manually restore _var_lib_mysql_.tar.gz to that folder, restart MySQL and hope. (there's a reason why the text "Warning: Exercise extreme caution if you select this setting. This setting backs up the data directory without stopping MySQL®. This action may cause InnoDB issues with the data directory backup." appears if an "Entire MySQL directory" option is selected)

    1
  • faisalag

    When the command was executed from within the ssh, the following output appeared

    [root@server accounts]# tar -tzvf user.tar.gz | grep "/mysql/"
    drwx------ root/root         0 2024-01-05 06:52 user/mysql/
    -rw------- root/root         5 2024-01-05 06:52 user/mysql/openfileslimit
    lrwxrwxrwx user/user         0 2021-09-02 08:31 user/homedir/.cagefs/tmp/mysql.sock -> /var/lib/mysql/mysql.sock

    I found the option was on "Per Account Only"

     

    1

Please sign in to leave a comment.