1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Back up and restore your web hosting solution with Swiss Backup and Restic
This guide shows you how to use Swiss Backup to back up the data from your web hosting solutions, regardless of whether they are on a cloud server or not.This enables you to keep occasional backups for longer, while our automatic backups currently have a limited retention period.
Swiss Backup is a backup solution that allows you to automate the process of backing up your files, workstations, mobiles and servers.Your data are stored in the Infomaniak data centers located in Switzerland, in at least three different physical locations.You can rest assured that nothing will be lost.
- Use a web hosting solution (discover our web hosting solutions)
- Have a Swiss Backup account (create an account free of charge)
2.Configure Swiss Backup
Create a location by following the FAQ below:https://faq.infomaniak.com/2546
1.Download the binary linux_amd64 from the restic github repository https://github.com/restic/restic/releases
uid@h2web:~$ wget -O restic.bz2 https://github.com/restic/restic/releases/download/v0.13.1/restic_0.13.1_linux_amd64.bz2
⚠️ the download link may vary when the new version is released
2.Unpack the archive and make the binary executable
uid@h2web:~$ bunzip2 restic.bz2
uid@h2web:~$ bunzip2 restic.bz2 uid@h2web:~$ chmod +x restic
1.Creation of an encryption key
- You must create an encryption key to encrypt the data
- Please note that the key cannot be changed and if lost, it will subsequently be impossible to read the data.
- Place this key in a file that can be read by Restic
- Example of how to generate a key
uid@h2web:~$ openssl rand -base64 16 > restickey
2.Configuration of restic
- Creation of the restic configuration is based on the accesses obtained when creating the Swiss Backup location.
- Create a resticconfig file with the following content by adapting with the access information to your Swiss Backup
uid@h2web:~$ cat >resticconf <
- OS_AUTH_URL Access url to the swissbackup cluster communicated by email when creating the access
- OS_PROJECT_NAME and OS_USERNAME Replace the SBI-XXXX with your username communicated by email when creating the access
- OS_PASSWORD Replace with the password generated when activating the swissbackup location
- Replace the SBI-XXXX with your username communicated by email when creating the access
- Replace the
with the name you want to give your container that stores the backups
- RESTIC_PASSWORD_FILE Replace with the full path to the file containing the encryption key
3.Load the Restic configuration
Load the Restic configuration using the following command:
4.Initialisation the of bucket
Initialise the bucket using the following command:
uid@h2:~$ ./restic -r $RESTIC_REPOSITORY init
5.Back up your files
To back up your file, simply execute the following command:
uid@h2:~$ ./restic backup
6.List your backups
To list your backups, you can use the following command
uid@h2:~$ ./restic snapshots
7.Restore a backup
You can restore a backup using the following command
uid@h2:~$ ./restic restore
On the cloud server, it is possible to add a cron task to automate execution of the backup:https://faq.infomaniak.com/350
On a shared hosting, this option is not available.