Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

New Servage Hosting account – Restore backups via SSH

Tuesday, July 9th, 2019 by Helge

Screenshot_2019-05-07-How-To-Log-In-Via-SSH-300x295In the new Servage control panel, we offer automated back ups – files and databases are stored in between 7 – 14 days by snapshots. The following information gives you an instruction how to restore the files and databases via SSH from the back up system. For each Servage hosting account, we provide one SSH account. To restore files from the back up, do these steps:

  • login to your SSH account
  • type: cd .snapshots  (make a note of dot before the word ‘snapshots’). This command will show you all backups.

You will see a list of date stamped folders where you can fetch data. This is how it should look like :

root@ser-staff-01# ls -ahl
total 64K

drwx–x— 1 1000850 www-data 516 Apr 26 02:00 .
drwx–x— 1 1000850 www-data 516 Apr 26 09:12 ..
drwx–x— 1 1000850 www-data 280 Apr 12 15:18 Daily_2018_04_13__02_00
drwx–x— 1 1000850 www-data 280 Apr 12 15:18 Daily_2018_04_14__02_00
drwx–x— 1 1000850 www-data 280 Apr 12 15:18 Daily_2018_04_15__02_00
drwx–x— 1 1000850 www-data 280 Apr 12 15:18 Daily_2018_04_16__02_00
drwx–x— 1 1000850 www-data 280 Apr 12 15:18 Daily_2018_04_17__02_00
drwx–x— 1 1000850 www-data 356 Apr 17 11:43 Daily_2018_04_18__02_00
drwx–x— 1 1000850 www-data 356 Apr 17 11:43 Daily_2018_04_19__02_00
drwx–x— 1 1000850 www-data 356 Apr 17 11:43 Daily_2018_04_20__02_00
drwx–x— 1 1000850 www-data 396 Apr 20 12:09 Daily_2018_04_21__02_00
drwx–x— 1 1000850 www-data 396 Apr 20 12:09 Daily_2018_04_22__02_00
drwx–x— 1 1000850 www-data 396 Apr 20 12:09 Daily_2018_04_23__02_00
drwx–x— 1 1000850 www-data 396 Apr 20 12:09 Daily_2018_04_24__02_00
drwx–x— 1 1000850 www-data 436 Apr 24 21:09 Daily_2018_04_25__02_00
drwx–x— 1 1000850 www-data 476 Apr 25 09:18 Daily_2018_04_26__02_00

You can then enter to the date stamped folders you want to fetch the data from by typing, for example:

root@ser-staff-01# cd Daily_2018_04_26__02_00

You will see your files of your account here. You can fetch the file content you want. These folders contain all backups of your files. Select the last created folder and see if the file is in it. If the file is created and then lost within a time span where a backup has not been taken then, it can not be recovered.

For restoring databases, please note that backups are saved in “db_backup” folder in customers homedir i.e in under the root (/) (every night is overwritten there), and this can also be revised by using snapshot for older backups.

Backups are saved in “db_backup” folder in customers homedir i.e in under the root (/) (every night is overwritten there), and this can also be revised by using snapshot for older backups.

  • login to your SSH account
  • type: cd .snapshots  (make a note of dot before the word ‘snapshots’)

Select the backup archive and go to its db_backup folder to get the db backup.

  • Now copy that to your account file manager: cp db-backup.sql.gz /storage/content/xx/xxxxxxx/
  • Now uncompress the backup: gunzip db-backup.sql.gz

First ensure you have a blank db created via control panel in which you should restore the backup. If not created, please create it first.

  • Then you can restore using this command: mysql -h <db server hostname> -u db_user -p db_name < db_backup.sql ->eg: mysql -h 04.mysql.servage.net -u 100xxxx_dbusername -p 100xxxx-newblankdb < backup_of_db.sql

When prompted for password, enter the blank database username’s password which you created.That will now restore the database backup to the new database in your control panel. You can later use phpmyadmin to check the restored database

New Servage Hosting account - Restore backups via SSH, 5.0 out of 5 based on 7 ratings
Categories: Guides & Tutorials
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.