Zum Inhalt springen

Backup, restore and clone

Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen

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.

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.

SettingDescriptionOptions
Backup ScheduleDefines how often on every day a backup is created6, 8, 12, 24 hours
Simple snapshot retentionNumber of days to retain backups2, 3, 4, 5 days
Daily snapshot retentionWhether daily backups are created and if yes, for how long they are keptNone, 3 - 360 days
Weekly snapshot retentionWhether weekly backups are created and if yes, for how long they are keptNone, 1 - 52 weeks
Monthly snapshot retentionWhether monthly backups are created and if yes, for how long they are keptNone, 1 - 12 months
Point in time windowTime window in the past for which transaction logs are kept30 hours

You can get an overview of the current backup settings of an instance.

FlagDescription
instance-idInstance ID of the instance you want to query
Terminal window
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) │ 3

BACKUP 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 modify your backup schedule to adapt the backup to your needs.

FlagDescription
instance-idInstance ID of the instance you want to query
scheduleSee Backup settings and their description
store-for-daysSee Backup settings and their description
store-daily-backup-daysSee Backup settings and their description
store-daily-backup-weeksSee Backup settings and their description
store-daily-backup-monthsSee Backup settings and their description
Terminal window
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 have an overview of the existing backups.

FlagDescription
instance-idInstance ID of the instance you want to query
Terminal window
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 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.

FlagDescriptionOptional
instance-idInstance ID of the instance you want to query
timestampTimestamp as of RFC3339 for point-in-time recoveryif backup-id is specified
backup-idID of existing backup. See List existing backups to get available backupsif timestamp is specified
backup-instance-idID of the target instancex

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.

Terminal window
stackit mongodbflex restore --instance-id <instance-id> --timestamp <timestamp> --backup-id <backup-id> --backup-instance-id <backup-instance-id>
Terminal window
stackit mongodbflex backup restore --instance-id yyy --timestamp 2024-05-14T14:31:48Z
Terminal window
stackit mongodbflex backup restore --instance-id zzz --backup-instance-id yyy --backup-id xxx

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.

  1. Navigate to Databases > Mongo DB Flex.

  2. Select your MongoDB Flex instance and go to Backup.

  3. Choose Clone.

  4. Select the target instance from the dropdown menu and confirm with the Clone button.

  5. Monitor the progress with the Restore status column.