Valid for: Web Hosting

To protect your data, IONOS automatically creates backups of your MySQL and MariaDB databases and keeps them for 14 days. This article shows you how to access these backups and, if necessary, reset your database to the state it was in at the time of the backup.

Note

If you have deleted the database in your IONOS account, it no longer appears in the database overview and you cannot start the restore described here. For web hosting packages and managed servers, databases that were deleted within the last 14 days can be restored. In this case, please contact IONOS Customer Support.

Step 1: Creating the recovery file

The recovery file is a ZIP-compressed text file in SQL format. It contains all the information required to restore the database in machine-readable form. To create the recovery file, complete the following steps:

  • Log in to your IONOS account.

  • Click Menu > Hosting in the title bar. If you have more than one hosting contract, select the contract you want.

  • In the Databases tile, click Manage. Your database overview is displayed.

  • In the Actions column next to the database you want to restore, click the three-dot icon and select Restore Database. The Database backups page opens.

  • In the Backups field, select the backup you want.

  • Click Download Database Backup.

    A recovery file is created. This may take a moment.

  • Click Download and save the recovery file to your computer.

You have now created a recovery file. The next section shows you how to restore your database using this file.

Step 2: Restoring the database with phpMyAdmin

Once you have created the recovery file, you can import it into your database to restore it. To do this, complete the following steps:

Please Note

Backups larger than 1 GB (gigabyte) must be restored using SSH access, as described below. Otherwise, the restore fails due to a timeout.

  • Log in to your IONOS account.

  • Click Menu > Hosting in the title bar. If you have more than one hosting contract, select the contract you want.

  • In the Databases tile, click Manage. Your database overview is displayed.

  • In the Admin column next to the database you want to import the backup into, click Open. IONOS phpMyAdmin opens in a new tab.

  • Switch to the IONOS phpMyAdmin tab and complete the following steps there.

  • In the navigation panel on the left, click the database name to select your database.

  • Click Import in the menu bar.

  • In the File to import section, click Choose File and select your recovery file.

  • To start the import and restore your data, click Go.

Optional: Restoring the database using SSH access

With web hosting packages, you can also restore your database using the SSH access of your package.

Note

The following instructions assume that you have already created the recovery file for the period you want. If you have not, create the file as described above in Step 1: Creating the recovery file. In this case, you do not need to download the file, because a copy is automatically saved to your webspace when it is created. You can then access this copy directly using SSH.

To restore a database using your SSH access, complete the following steps:

  • Connect to your webspace using SSH and switch to the terminal window of your SSH connection. For instructions, see the article Connecting to Your Webspace via Secure Shell (SSH) using PuTTY.

  • To change to the directory of the recovery file, enter the cd command using the following pattern:

    cd _ProviderRestore_DATABASE_NAME

    Replace the placeholder DATABASE_NAME with the name of your database.

    Example:

    cd _ProviderRestore_db12345678

  • To restore your database, use the MySQL client together with the archiving program gunzip, using the following pattern:

    gunzip -c FILE | mysql --host=DATABASE_HOSTNAME --user=DATABASE_USERNAME --password=DATABASE_PASSWORD DATABASE_NAME

    Replace the placeholders FILE, DATABASE_HOSTNAME, DATABASE_USERNAME, DATABASE_PASSWORD, and DATABASE_NAME with the details of your database.

    Example:

    gunzip -c db123456789_2020-09-17.sql.gz | mysql --host=db123456789.hosting-data.io --user=dbu123456789 --password=Zoteb%Ipayu612 db123456789

Your database is now being restored. This may take some time. You cannot enter any other commands while the restore is running.