Backup and Recovery

Backups

MongoDB Backups: A cluster can have multiple snapshots. A snapshot is a copy of the data in the cluster at a certain time and is added during the following cases:

  1. When a cluster is created, known as initial sync which usually happens in less than 24 hours.

  2. After a restore.

  3. Every 24 hours, a base snapshot is taken, and every Sunday, a full snapshot is taken.

Snapshots are retained for the last seven days; hence, recovery is possible for up to a week from the current date. You can restore from any snapshot as long as it was created with the same or older MongoDB patch version.

Snapshots are stored in an IONOS S3 Object Storage bucket in the same region as your database. Databases in regions where IONOS S3 Object Storage is not available is backed up to eu-central-2.

Warning: If you destroy a MongoDB cluster, all of its snapshots are also deleted.

Offsite Backup

MongoDB Enterprise edition supports Offsite Backups, this allows backup data being stored in a location other than the deployed database cluster.

Available locations are de, eu-south-2, eu-central-2.

Info: The location can only be set during cluster creation. Changes to the backup location of a provisioned cluster will result in unexpected behaviour.

Request

curl --include \
    --request POST \
    --user "clientname@ionos.com:Mb2.r5oHf-0t" \
    --header "Content-Type: application/json" \
    --data-binary '{
      "metadata": {},
      "properties": {
        "edition": "enterprise",
        "backup": {
          "location": "de"
        },
        ...
    }' \
    https://api.ionos.com/databases/mongodb/clusters

Recovery

Recovery is achieved via the restore jobs. A restore job is responsible to create and catalog a cluster restoration process. A valid snapshot reference is required for a restore job to recover the database. The API exposes available snapshots of a cluster.

There must be no other active restore job for the cluster to create a new one.

Warning: When restoring a database, it is advised to avoid connections to it until its restore job is complete and the cluster reaches AVAILABLE state.

Point in time recovery

This feature is available only for enterprise clusters. The restoration of cluster here includes points in time and operations log (oplog) timestamps. A custom snapshot can be created for the exact oplog timestamp that you choose to restore the database cluster is possible with point in time recovery.

For more information on restoring database from backup by using the Cloud API, see Restore a Database.

Last updated