Back to home

How to restore databases?

In the article you read how and when the databases on your managed (V)Server are backed up. In this article you will find short instructions on how to restore these dumps quickly and easily in case of need.

  • Log in to your server using SSH.

  • Use the cat (concatenate) program to output the contents of the restore script, which lists the backed up databases and the corresponding restore command:

    cat /home/db-backup/dumps_per_db/2019-07-16-0100/

    Please adapt the character string with the date according to your wish.

  • The program prints the file completely, at the end of which we find one or more lines with the names of the databases on your server:

    zstdcat db_test/*.zst | mysql -h localhost “db_test”

  • Copy the line with the database you want to restore to the clipboard and paste it immediately into the console.

  • Add the username and password of your database to the copied and pasted line:

    zstdcat db_test/*.zst | mysql -u user_name -p[password] -h localhost "db_test"
  • Please check your entries before confirming them with Enter.

Didn't find what you were looking for?

Contact our support:

+41 44 637 40 40 Support Portal