1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Backup web hosting with Swiss Backup and Restic
This guide explains how to use Swiss Backup to back up your web hosting data (shared or cloud server - read point 8 below).
This makes it possible to keep backups that you make from time to time longer, while our automatic backups have a limited shelf life.
Swiss Backup is a backup solution that allows you to automate the backup of your files, workstations, mobiles and servers. Your data is stored in Switzerland in Infomaniak datacenters in at least three different physical locations. You are therefore guaranteed not to lose anything.
- Using web hosting (discover our web hosting)
- Have a Swiss Backup account (create an account for free)
Configure Swiss Backup
Create a location.
1. Download the linux_amd64 binary 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.14.0/restic_0.14.0_linux_amd64.bz2< /span>
⚠️ Download link may vary when new version is released. Version 0.14 uses compression by default.
2. Unzip the archive and make the binary executable
uid@h2web:~$ bunzip2 restic.bz2
uid@h2web:~$ chmod +x restic
1. Creating an encryption key
- You must create an encryption key to encrypt the data
- Please note that the key cannot be changed and in case of loss the data will no longer be readable.
- Place this key in a file readable by Restic
- Example generating a key
uid@h2web:~$ openssl rand -base64 16 > restickey
2. Configuring restic
- The creation of the restic configuration is based on the access obtained when creating the Swiss Backup location
- Create a resticconfig file with the following content, adapting it with the access information to your Swiss Backup
echo "export OS_AUTH_URL=https://swiss-backupXX.infomaniak.com/identity/v3
export RESTIC_PASSWORD_FILE=restickey" > ; resticconf
- OS_AUTH_URL Access URL to the swissbackup cluster sent 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
with the name you want to give to your container that stores backups
- RESTIC_PASSWORD_FILE replace with the full path to the file containing the encryption key
3. Loading Restic configuration
Load the Restic configuration by issuing the following command:
4. Bucket initialization
Initialize the bucket with the following command:
uid@h2:~$ ./restic -r $RESTIC_REPOSITORY init
Back up your files
To back up your files, just run the following command:
uid@h2:~$ ./restic backup