Video Transcript (English)
Welcome! In this video, you’ll learn how to restore a dedicated cluster from Atlas Cloud Backups. Specifically, this is the “M10” instance class and higher.
Specifically, we’ll cover how to restore from an on-demand snapshot and Continuous Cloud Backups by using the Atlas UI. We will also cover how to use a point-in-time restore.
Atlas Cloud Backups support easy data recovery by allowing you to restore to the current Atlas cluster or to another Atlas cluster from any specific snapshot. It also allows you to restore your data to a specific timestamp within your point-in-time window, when Continuous Cloud Backups are enabled.
Let’s restore a snapshot from a dedicated M10 cluster to an empty M10 cluster. The backup snapshot must be restored to a cluster that’s running either the same major release version or the next higher one. Atlas doesn’t support restoring to older versions. The instance type, M10, is the same for both clusters in this example. However, restores can be done on two dedicated clusters with different instance types as well.
We’ll navigate to the Backup tab of our M10 cluster, where all available snapshots are displayed.
There are three options for viewing snapshots: “All” shows all available snapshots. “On Demand” shows all on-demand snapshots. And “Policy” shows all scheduled snapshots taken using the Cloud Backup policy.
For this demonstration, we’ll select the on-demand snapshot to restore from, but we would follow the same process to restore a scheduled snapshot.
Under the Actions for this snapshot, we select the Restore button.
In the pop-up that appears, we select the Target Project and Target Cluster to restore this on-demand snapshot to. In this example, Curriculum Sandbox is the Target Project, and ClusterRestore-onDemand is the Target Cluster.
Then we type “I Agree” and select Restore.
Next, we navigate to the ClusterRestore-onDemand cluster on the Database Deployments page.
When the restore is completed, you will see your cluster populated with data.
If your new cluster has continuous cloud backup enabled, when you look at the backups, you will see that a snapshot was created already.
Great! We've restored an on-demand cloud backup to an Atlas cluster.
Now, let’s restore a dedicated cluster to a specific point in time by using Continuous Cloud Backups. Point-in-time, or PIT, restores include an additional step to replay the oplog from the snapshot time to the particular point in time that we’ve chosen.
Remember that the point in time must be within the window specified in the cluster’s backup policy. The PIT window is configurable in 24-hour increments, with 2 days as the default value. The maximum PIT window depends on the hourly snapshot retention.
First, let’s use Atlas to insert the following two documents into the `transfers` collection in the `bank` database of the dedicated cluster.
Now, we’ll perform a PIT restore back to the insertion of the first document only. To do this, we first navigate to the Backup tab of our cluster on the Database Deployments page
Then we select “Point In Time Restore”.
There are two options to complete a PIT restore: Date & Time, and Oplog Timestamp.
We’ll choose the Date & Time option first.
This text tells us the earliest point in time that we can restore to. In this case, it is April 26, 2023, at 18:04 UTC.
For the date, we’ll select 04/28/2023. For time, we’ll select 19:50 UTC, which is after the insertion of the first document but before the second. Then we’ll click the button to select the cluster.
In this window, we select the Target Project and Target Cluster for this PIT restore. In this example, Curriculum Sandbox is our Target Project, and PITRestore is our Target Cluster.
Then we type “I Agree” and select Restore.
To confirm that the PIT restoration was successful, we navigate to the `transfers` collection of the `bank` database in the PITRestore cluster. Then we query for documents that have the transfer_id’s TR111222333 and TR111222334.
As expected, there is a query result for the first document that we inserted, but no query results for the second document. This confirms that we have successfully completed a PIT restore by using the Date and Time of insertion from the first document.
Now let's try a PIT restore by using the oplog timestamp. We navigate back to the Point in Time Restore window and select Oplog Timestamp as the method.
There are two fields to fill out: Timestamp and Increment. These values are found in the `oplog.rs` collection of the `local` database. In this example, we’ll use the oplog with a Timestamp of 1682711519 and an Increment of 1.
In this window, we select Curriculum Sandbox as our Target Project and PITRestore as our Target Cluster. Then we type “I Agree” and select Restore.
To confirm that this PIT restoration was successful, we navigate to the `transfers` collection of the `bank` database in the PITRestore cluster. Then we query for documents that have the transfer_id’s TR111222333 and TR111222334.
As expected, there is a query result for the first document that we inserted, but no query results for the second document. This confirms that we have successfully completed another PIT restore by using the oplog for the first document’s insertion.
These examples show how simple it is to revert data to a specific point in time. This is useful in the event of errors, or when we need to load production data into a separate development environment for testing, for example. Corrupted or lost data can be quickly recovered and restored by using Atlas Cloud Backups.
Congratulations! You now know how to restore a dedicated Atlas cluster by using on-demand snapshots. You also know how to complete a point-in-time restore by using Continuous Cloud Backups in the Atlas UI.