Restore a deleted container or database to the same Azure Cosmos DB account (preview)
APPLIES TO: NoSQL MongoDB Gremlin Table
The Azure Cosmos DB point-in-time same-account restore feature helps you recover from an accidental deletion of a container or database. This feature restores the deleted database or container to the same, existing account in any region in which backups exist. Continuous backup mode allows you to restore to any point of time within the last 30 days.
- An Azure subscription. If you don't have an Azure subscription, create a free Azure account before you begin.
- An Azure Cosmos DB account. You can choose one of the following options for an Azure Cosmos DB account:
Restore a deleted container or database
Use the Azure portal, the Azure CLI, Azure PowerShell, or an Azure Resource Manager template to restore a deleted container or database in the same, existing account.
Use the Azure portal to restore a deleted container or database. Child containers are also restored.
Go to the Azure portal.
Go to your Azure Cosmos DB account, and then go to the Point In Time Restore page.
The restore page in Azure portal is populated only if you have the
Microsoft.DocumentDB/locations/restorableDatabaseAccounts/*/readpermission. To learn more about this permission, see Backup and restore permissions.
Select the Restore to same account tab.
For Database, enter a search query to filter the event feed for relevant deletion events for a container or a database.
Next, specify Start and End values to create a time window to use to filter deletion events.
The Start filter is limited to at most 30 days before the present date.
Select Refresh to update the list of events for different resource types with your filters applied.
Verify the time, and then select Restore to start restoration of the selected resource that was previously deleted.
No more than three restore operations can be active at any time on the same account. Deleting the source account while a restore operation is in progress might result in the failure of the restore operation.
The event feed displays resources as Not restorable. The feed provides more information about why the resource can't be restored. In most cases, you must restore the parent database before you can restore any of the database's child containers.
After you initiate a restore operation, track the operation by using the notifications area of the Azure portal. The notification provides the status of the resource that's being restored. While restore is in progress, the status of the container is Creating. After the restore operation completes, the status changes to Online.
Track the status of a restore operation
When a point-in-time restore is initiated for a deleted container or database, the operation is identified as an InAccount restore operation on the resource.
To get a list of restore operations for a specific resource, filter the activity log of the account by using the InAccount Restore Deleted search filter and a time filter. The list that's returns includes the UserPrincipalName field, which identifies the user who initiated the restore operation. For more information about how to access activity logs, see Audit point-in-time restore actions.
- Enable continuous backup by using the Azure portal, Azure PowerShell, the Azure CLI, or Azure Resource Manager.
- Learn how to migrate an account from periodic backup to continuous backup.
- Review the continuous backup mode resource model.
- Manage the permissions that are required to restore data by using continuous backup mode.