Backup and restore your instances
Prerequisites
Section titled “Prerequisites”- You have created a Redis instance.
Check Create and manage instances for Redis
Introduction
Section titled “Introduction”Backup and restore is an essential feature to guarantee the SLAs of your service. STACKIT’s Redis offers backup and restore capabilities to help you achieving this goal. These are the features of the backup and restore capabilities:
- Backup and in-place-restore of your instances
- Automated scheduled backups every 4 hours
- Create manual backups
- Download your backups
- backup retention for 14 days
- All settings are accessible by the portal, the CLI, Cloud Foundry and Terraform
Backup
Section titled “Backup”STACKIT’s Redis automatically creates a backup every 4 hours. This backups are held for 14 days. If you want a longer backup history, you need to download the created backups.
You don’t pay for the backup itself, but for the storage the generated backup files reserve. The storage size depends on your backup settings and of the accumulated instance databases size. At the moment you need to estimate the storage need by yourself.
Backup settings and their description
Section titled “Backup settings and their description”| Setting | Description | Options |
|---|---|---|
| Encryption Key | Defines the key with which the STACKIT system encrypts the backup | custom string |
List existing backups
Section titled “List existing backups”You can get an overview of all existing backups.
You can view all backups by navigating to the Backups tab at the service dashboard of your instance.
-
Open your project in the STACKIT Portal
-
Navigate to Databases > Redis
-
Select your Redis instance and go to Overview
-
On the pane on the left select Backups
-
You see a list of all backups with their properties:
ID, Start time, End time, Backup size, Backup status, Restore created at
If you created an encryption key prior to the start time of a backup, you are able to download it via the thre dots menu on the right of the entry.
Create an encryption key
Section titled “Create an encryption key”You can create an encryption key to be able to download your backups.
To create an encryption key follow the steps below. You need to store the key in a safe place.
- Open your project in the STACKIT Portal
- Navigate to Databases > Redis
- Select your Redis instance and go to Overview
- On the pane on the left click on Backups
- On the top bar click on Create encryption key
- Enter an encryption key with a minimum length of 8 characters and click on Create
Trigger a manual backup
Section titled “Trigger a manual backup”You can trigger a manual backup everytime.
You can trigger a manual backup in the backup overview pane.
- Open your project in the STACKIT Portal
- Navigate to Databases > Redis
- Select your Redis instance and go to Backups
- Click on Create manual backup
- In the popup click on create
- Wait until the status of the backup becomes Done
Download a backup
Section titled “Download a backup”You can trigger a manual backup everytime.
You can download a backup in the backup overview pane.
- Open your project in the STACKIT Portal
- Navigate to Databases > Redis
- Select your Redis instance and go to Backups
- Choose a backup to download and click on the three-dots-menu
- Click on Download If there is no Download option, then the backup was created without encryption. Always Create an encryption key before inserting important data into your instance.
- Wait until the download finishes
Restore
Section titled “Restore”You can restore a specific backup to the same instance. To restore your backup to a new instance, you need to download the backup and restore it manually after creating a new instance.
Managed restore to the same instance
Section titled “Managed restore to the same instance”You can do a restore by navigating to the Backups tab at the service dashboard of your instance and unsing the restore button.
- Open your project in the STACKIT Portal
- Navigate to Databases > Redis
- Select your Redis instance and go to Backups
- Click on the three dots menu of the right side of your desired backup you plan to restore
- Click on Restore
- On the popup, read the warning that all data in your instance gets overwritten
- If this is ok, click on Restore
Decrypting of a downloaded backup file
Section titled “Decrypting of a downloaded backup file”You can download and decrypt your backup files. This is useful, if you plan to store your data independently of STACKIT.
- Download the encrypted backup
- Open your project in the STACKIT Portal
- Navigate to Databases > Redis
- Select your Redis instance and go to Backups
- Click on the three dots menu of the right side of your desired backup you plan to restore and click on Download
- Wait for the download to finish
- Decrypt the downloaded backup
-
Open a shell and navigate to the folder where you downloaded the backup into
-
Decrypt and unzip the backup:
<encrypted-backup-file>is the placeholder for the downloaded file.<target-backup-file-prefix>is the name of the target file without the file ending. You can freely choose this name according to the limitations of your local file system.Terminal window cat <encrypted-backup-file> | openssl enc -aes256 -md md5 -d -pass 'pass:<encryption-key>' > <target-backup-file-prefix>.rdb.tar.gztar -xvjf <target-backup-file-prefix>.sql.gz -
Verify the file: Use the
filecommand to verify the decrypted and uncompressed backup:Terminal window file dump.rdbIf everything is correct,
filewill return something like this:dump.rdb: Redis RDB file, version 0011
-