Share via

how to restore a cosmos db with new name in my resource group

2026-06-11T23:37:16.6933333+00:00

 Se requiere una restauración de esta bbdd cosmos  cdaeuecpprdave2-1

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.


3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Jose Benjamin Solis Nolasco 8,076 Reputation points Volunteer Moderator
    2026-06-12T01:36:48.2133333+00:00

    Welcome to Microsoft Q&A,

    Hello Francisco, I hope you are doing well,

    To restore your Azure Cosmos DB account cdaeuecpprdave2-1 with a new name within the same resource group, you can utilize the Azure CLI. The exact command depends on whether you need to restore the entire database account architecture or just a specific database inside the existing account.

    Path 1: Restore the Entire Account with a New Name

    To create a completely new Cosmos DB account containing your restored data, use the az cosmosdb restore command. You must specify a unique target name and your point-in-time restore timestamp (UTC format):

    Bash

    az cosmosdb restore \
      --account-name cdaeuecpprdave2-1 \
      --target-database-account-name <YourNewCosmosAccountName> \
      --resource-group <YourResourceGroup> \
      --location 
    

    Path 2: Restore a Specific Deleted Database Only

    If you only need to restore a single SQL (Core) or MongoDB API database back into the existing cdaeuecpprdave2-1 live account without creating a new resource, use the specific API sub-commands:

    For SQL (Core) API:

    Bash

    az cosmosdb sql database restore \
      --account-name cdaeuecpprdave2-1 \
      --resource-group <YourResourceGroup> \
      --name <YourDatabaseName> \
      --restore-timestamp 2026-06-10T16:00:00+0000
    

    For MongoDB API:

    Bash

    az cosmosdb mongodb database restore \
      --account-name cdaeuecpprdave2-1 \
      --resource-group <YourResourceGroup> \
      --name <YourDatabaseName> \
      --restore-timestamp 2026-06-10T16:00:00+0000
    

    Important Post-Restore Note: When restoring to a new account name, remember that control plane configurations, such as Virtual Network service endpoints/ACLs, firewall rules, multi-region routing, and custom roles. Do not carry over automatically and must be reconfigured manually on the newly created resource.

    😊 If my answer helped you resolve your issue, please consider marking it as the correct answer. This helps others in the community find solutions more easily. Thanks!

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-06-11T23:37:27.94+00:00

    To restore an Azure Cosmos DB account with a new name in the same resource group using Azure CLI, use the az cosmosdb restore command and specify the source account, target account name, resource group, location, and restore timestamp.

    Example (continuous backup or periodic backup with account-level restore):

    az cosmosdb restore \
      --target-database-account-name <NewCosmosAccountName> \
      --account-name cdaeuecpprdave2-1 \
      --restore-timestamp 2024-06-10T16:03:41+0000 \
      --resource-group <MyResourceGroup> \
      --location "<RegionOfSourceAccount>" \
      --public-network-access Disabled \
      --disable-ttl True
    

    Key parameters:

    • --account-name: existing source Cosmos DB account (cdaeuecpprdave2-1).
    • --target-database-account-name: new account name to restore into.
    • --resource-group: resource group where the new account will be created (can be the same as the source).
    • --location: write region of the restored account; must match the backup location (or use --source-backup-location if different).
    • --restore-timestamp: UTC timestamp to which the account should be restored.
    • Optional scoping parameters:
      • --databases-to-restore, --gremlin-databases-to-restore, --tables-to-restore to restore only selected databases/graphs/tables.
      • --public-network-access to control public access (ENABLED/DISABLED).
      • --disable-ttl to restore with TTL disabled.

    If only a single deleted SQL or MongoDB database inside the same account needs to be restored (not the whole account), use:

    SQL API database restore:

    az cosmosdb sql database restore \
      --account-name cdaeuecpprdave2-1 \
      --name <DatabaseName> \
      --resource-group <MyResourceGroup> \
      --restore-timestamp 2024-06-10T16:03:41+0000 \
      --disable-ttl True
    

    MongoDB API database restore:

    az cosmosdb mongodb database restore \
      --account-name cdaeuecpprdave2-1 \
      --name <DatabaseName> \
      --resource-group <MyResourceGroup> \
      --restore-timestamp 2024-06-10T16:03:41+0000 \
      --disable-ttl True
    

    After the restore completes, the new account will have a different name but the restored data. Some settings (for example VNET ACLs, stored procedures/triggers/UDFs, multi-region settings, managed identities) are not carried over and must be reconfigured on the new account.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.