How to restore your Hypernode from a backup
To restore your Hypernode from a backup use the steps below.
Table of contents
- 1 Request a backup
- 2 Restore on DigitalOcean
- 3 Restore on Amazon (AWS)
Request a backup
If the ventilator has been hit and you need to restore your node from a backup, contact Support to request a backup of either the database or the files or both.
To request a backup, always make sure you know:
- The date of the backup you need
- Whether you need a file or a database backup
- In case of a file backup: do you need a directory or file or a full restore of all the content
- In case of a full file restore: check if there is enough disk space available to restore or cleanup unused files to ensure there is enough space.
Restore on DigitalOcean
Restore a database backup on DigitalOcean
When we restore a database backup, you’ll find a database dump compressed with
The name of this backup has the format
To restore this backup you can use either n98-magerun or use the MySQL client utility:
n98-magerun db:import --root-dir=~/public <backup_filename>
Note: use n98-magerun2 for magento2 shops.
Using MySQL client:
zcat <backup_filename> | mysql <database_name> -u <magento db user> -p'<magento db pass>'
And wait until the database is fully imported.
This might take a while for large databases, so get yourself some coffee in the meantime.
Restore a file backup on DigitalOcean
When you request a file backup on a Hypernode at DigitalOcean, we create a directory in your homedir in which we restore from a certain point in time.
To restore this backup, remove the old file or directory and copy the file(s) and/or directories in place in your
IE: if you need to restore the
media directory, use the command:
rm -rvf /data/web/public/media/ && mv restore/media /data/web/public/
If you need some visual assistance, you can use
mc (midnite commander).
Restore on Amazon (AWS)
On Amazon (AWS) we use snapshots to create backups. Snapshots are a static copy of all data present on the disk that can be mounted on your AWS Hypernode as a new file system on
When the file system is mounted, you can easily restore your files by copying them from the file system.
For databases we start an extra instance of MySQL running om port 3307 so you can easily create a dump of the database or load the data from the backup instance to the production instance.
When the restore is finished the backup snapshot is not automagically detached/unmounted. There is a second MySQL instance running so you’ll lose some resources. Please contact Support so we can remove your snapshots manually.
Restore a database on AWS
Create a database dump
To create a database dump from the backup instance, connect to port 3307 with the
mysqldump utility and create a dump:
DATABASE="magento2" mysqldump $DATABASE -p 3307 | gzip > /data/web/dump.sql.gz
When the export is created, a backup file can be found in
Dump the data from the backup MySQL instance into the production database.
To restore the backup and immediately import it in the production database use the following command:
DATABASE="magento2" mysqldump $DATABASE -p 3307 | mysql $DATABASE
Restore a file backup on AWS
To restore your files, copy the files from
/data/backup/current to your