Backup, restore and clone
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
Prerequisites
Section titled “Prerequisites”- You have created a MongoDB Flex instance.
Check Create and manage instances for MongoDB Flex.
Introduction
Section titled “Introduction”Backup and restore is an essential feature to garuantee the SLAs of your service. STACKIT’s MongoDB Flex offers a wide variety of different backup and restore capabilities to help you achieve this goal. These are the features of the backup and restore capabilities:
- Backup, clone and restore all of your instances
- Point-in-time restore for the last 30 hours
- Snapshot retention to up for a year
- Up to 4 simple snapshots per day
- Simple snapshot retention up to five days
- Independent daily, weekly and monthly snapshots with individual retention times
- GFS backup scheme configurable
- Restoring and cloning to other instances in the same project
- All settings are accessible via the Portal, the CLI, Cloud Foundry and Terraform.
Backup
Section titled “Backup”You can configure the backup settings to the needs of your business. STACKIT’s MongoDB Flex offers snapshots on a daily, weekly and monthly base and furthermore saves transaction logs. The latter gives you the chance to restore to an arbitrary point in time within the point in time window of 30 hours. Daily, weekly, monthly and simple snapshot retention times can be configured independently.
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 |
|---|---|---|
| Backup Schedule | Defines how often on every day a backup is created | 6, 8, 12, 24 hours |
| Simple snapshot retention | Number of days to retain backups | 2, 3, 4, 5 days |
| Daily snapshot retention | Whether daily backups are created and if yes, for how long they are kept | None, 3 - 360 days |
| Weekly snapshot retention | Whether weekly backups are created and if yes, for how long they are kept | None, 1 - 52 weeks |
| Monthly snapshot retention | Whether monthly backups are created and if yes, for how long they are kept | None, 1 - 12 months |
| Point in time window | Time window in the past for which transaction logs are kept | 30 hours |
View backup settings
Section titled “View backup settings”You can get an overview of the current backup settings of an instance.
| Flag | Description |
|---|---|
| instance-id | Instance ID of the instance you want to query |
stackit mongodbflex backup schedule --instance-id <instance-id>You get an output like this:
BACKUP SCHEDULE (UTC) │ 39 10/8 * * *─────────────────────────────────────┼─────────────── DAILY SNAPSHOT RETENTION (DAYS) │ 0─────────────────────────────────────┼─────────────── MONTHLY SNAPSHOT RETENTION (MONTHS) │─────────────────────────────────────┼─────────────── POINT IN TIME WINDOW (HOURS) │ 30─────────────────────────────────────┼─────────────── SNAPSHOT RETENTION (DAYS) │ 3─────────────────────────────────────┼─────────────── WEEKLY SNAPSHOT RETENTION (WEEKS) │ 3BACKUP SCHEDULE (UTC) is the representation for the Backup Schedule setting. It follows the cron format. The important number is behind the slash and reflects if a backup is run either every 6, 8, 12 or 24 hours. DAILY SNAPSHOT RETENTION (DAYS), WEEKLY SNAPSHOT RETENTION (WEEKS)and MONTHLY SNAPSHOT RETENTION (MONTHS) corresond to Daily Snapshot Retention, Weekly Snapshot Retention and Monthly Snapshot Retention. SNAPSHOT RETENTION (DAYS) represents Snapshot Retention (simple snapshots). The POINT IN TIME WINDOW (HOURS) shows the amount of time for which you can restore to a specific point in time. From a technical standpoint it represents the length of the transaction log.
You can view the backup settings by navigating to the Backups tab at the dashboard of your instance and clicking the schedule button on the top right side.
-
Navigate to Databases > Mongo DB Flex.
-
Select your MongoDB Flex instance and go to Backup.
-
On the top right corner, click on Schedule.
-
Set everything to your needs. See Backup settings and their description for the meaning of every setting.
-
To leave the pane, click on Cancel.
Modify backup settings
Section titled “Modify backup settings”You can modify your backup schedule to adapt the backup to your needs.
| Flag | Description |
|---|---|
| instance-id | Instance ID of the instance you want to query |
| schedule | See Backup settings and their description |
| store-for-days | See Backup settings and their description |
| store-daily-backup-days | See Backup settings and their description |
| store-daily-backup-weeks | See Backup settings and their description |
| store-daily-backup-months | See Backup settings and their description |
stackit mongodbflex update-backup schedule --instance-id <instance-id> --schedule <schedule> --store-for-days <store-for-days> --store-daily-backup-days <daily-backup-days> --store-weekly-backup-weeks <weekly-backup-weeks> --store-monthly-backups-months <monthly-backup-months>You can configure the backup settings by navigating to the Backups tab at the service dashboard of your instance and clicking the schedule button on the top right side.
-
Navigate to Databases > Mongo DB Flex.
-
Select your MongoDB Flex instance and go to Backup.
-
On the top right corner, click on Schedule.
-
Set everything to your needs. See Backup settings and their description for the meaning of every setting.
-
To confirm, click on Save.
List existing backups
Section titled “List existing backups”You can have an overview of the existing backups.
| Flag | Description |
|---|---|
| instance-id | Instance ID of the instance you want to query |
stackit mongodbflex list --instance-id <instance-id>You get something like this:
ID │ CREATED AT │ EXPIRES AT │ BACKUP SIZE │ RESTORE STATUS──────────────────────────┼──────────────────────┼──────────────────────┼─────────────┼──────────────── 689190e5481e264f2594fbf2 │ 2025-08-05T05:02:45Z │ 2025-08-08T05:01:00Z │ 2.57MB │ - 68913ca485a6c1739e430cd8 │ 2025-08-04T23:03:44Z │ 2025-08-07T23:01:00Z │ 2.57MB │ - 6890e8175d9e7576ae47710b │ 2025-08-04T17:02:33Z │ 2025-08-07T17:01:00Z │ 2.57MB │ -The timestamps are in UTC.
You can get a list of existing backups by navigating to the Backups tab at the dashboard of your instance.
-
Navigate to Databases > Mongo DB Flex.
-
Select your MongoDB Flex instance and go to Backup.
-
Now you can see every available backup.
The timestamps are in UTC.
Restore
Section titled “Restore”You can restore a specific backup either to the same instance or to another instance within the same STACKIT project. You can do a point-in-time restore or restore a specific backup with its ID.
| Flag | Description | Optional |
|---|---|---|
| instance-id | Instance ID of the instance you want to query | |
| timestamp | Timestamp as of RFC3339 for point-in-time recovery | if backup-id is specified |
| backup-id | ID of existing backup. See List existing backups to get available backups | if timestamp is specified |
| backup-instance-id | ID of the target instance | x |
If you omit the backup-instance-id-flag, the backup will be restored to the same instance which you specified with instance-id. You can do a point-in-time restore to another target instance.
stackit mongodbflex restore --instance-id <instance-id> --timestamp <timestamp> --backup-id <backup-id> --backup-instance-id <backup-instance-id>Examples
Section titled “Examples”stackit mongodbflex backup restore --instance-id yyy --timestamp 2024-05-14T14:31:48Zstackit mongodbflex backup restore --instance-id zzz --backup-instance-id yyy --backup-id xxxYou can do a restore by navigating to the Backups tab at the service dashboard of your instance and clicking the options button on the right side of the selected backup.
-
Navigate to Databases > Mongo DB Flex.
-
Select your MongoDB Flex instance and go to Backup.
-
Choose Restore.
-
Select if you want to restore to the current instance or to another one within your STACKIT project.
-
If you choose to restore to another instance, select it from the dropdown menu and confirm with the Restore button.
-
Monitor the progress with the Restore status column.
You can clone the backup with a point-in-time restore either to the same instance or to another instance within the same STACKIT project.
The point-in-time is fixed set to the current time, when you click on clone.
You can do a clone by navigating to the Backups tab at the service dashboard of your instance and clicking the Options button on the right side of the selected backup.
-
Navigate to Databases > Mongo DB Flex.
-
Select your MongoDB Flex instance and go to Backup.
-
Choose Clone.
-
Select the target instance from the dropdown menu and confirm with the Clone button.
-
Monitor the progress with the Restore status column.