Skip to content

Commit 7993c50

Browse files
Merge pull request #237157 from kanshiG/docs-editor/restore-account-continuous-bac-1683327058
Update restore-account-continuous-backup.md
2 parents 9b3516a + d46f68a commit 7993c50

File tree

1 file changed

+54
-50
lines changed

1 file changed

+54
-50
lines changed

articles/cosmos-db/restore-account-continuous-backup.md

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ Restore-AzCosmosDBAccount `
150150
```
151151
If `PublicNetworkAccess` is not set, restored account is accessible from public network, please ensure to pass Disabled to the `PublicNetworkAccess` option to disable public network access for restored account.
152152

153-
[NOTE]
153+
> [!NOTE]
154154
> For restoring with public network access disabled, you'll need to install the preview of powershell module of CosmosDB by executing `Install-Module -Name Az.CosmosDB -AllowPrerelease`. You would also require version 5.1 of the Powershell.
155-
>
155+
156156
**Example 2:** Restoring specific collections and databases. This example restores the collections *MyCol1*, *MyCol2* from *MyDB1* and the entire database *MyDB2*, which, includes all the containers under it.
157157

158158
```azurepowershell
@@ -350,7 +350,6 @@ Get-AzCosmosdbGremlinRestorableGraph `
350350
-DatabaseRId "AoQ13r==" `
351351
-Location "West US"
352352
```
353-
354353
#### Find databases or graphs that can be restored at any given timestamp
355354

356355
Use the following command to get the list of databases or graphs that can be restored at any given timestamp. This command only works with live accounts.
@@ -376,7 +375,6 @@ Get-AzCosmosdbTableRestorableTable `
376375
-DatabaseAccountInstanceId "d056a4f8-044a-436f-80c8-cd3edbc94c68"
377376
` -Location "West US"
378377
```
379-
380378
#### Find tables that can be restored at any given timestamp
381379

382380
Use the following command to get the list of tables that can be restored at any given timestamp. This command only works with live accounts.
@@ -390,6 +388,7 @@ Get-AzCosmosdbTableRestorableResource `
390388
```
391389

392390

391+
393392
## <a id="restore-account-cli"></a>Restore an account using Azure CLI
394393

395394
Before restoring the account, install Azure CLI with the following steps:
@@ -410,63 +409,64 @@ The simplest way to trigger a restore is by issuing the restore command with nam
410409

411410
#### Create a new Azure Cosmos DB account by restoring from an existing account
412411

413-
```azurecli-interactive
412+
```azurecli-interactive
414413
415-
az cosmosdb restore \
416-
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
417-
--account-name MySourceAccount \
418-
--restore-timestamp 2020-07-13T16:03:41+0000 \
419-
--resource-group MyResourceGroup \
420-
--location "West US"
421-
--public-network-access Disabled
414+
az cosmosdb restore \
415+
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
416+
--account-name MySourceAccount \
417+
--restore-timestamp 2020-07-13T16:03:41+0000 \
418+
--resource-group MyResourceGroup \
419+
--location "West US"
420+
--public-network-access False
422421
423-
```
424-
If `public-network-access` is not set, restored account is accessible from public network, please ensure to pass Disabled to the `public-network-access` option to disable public network access for restored account.
422+
```
423+
If `public-network-access` is not set, restored account is accessible from public network, please ensure to pass Disabled to the `public-network-access` option to `False` public network access for restored account.
424+
425+
> [!NOTE]
426+
> For restoring with public network access disabled, you'll need to install the cosmosdb-preview 0.23.0 of CLI extension by executing `az extension update --name cosmosdb-preview `. You would also require version 2.17.1 of the CLI.
425427
426-
> [NOTE]
427-
> For restoring with public network access disabled, you'll need to install the cosmosdb-preview 0.23.0 of CLI extension by executing `az extension update --name cosmosdb-preview `. You would also require version 2.17.1 of the CLI.
428428

429429

430430
#### Create a new Azure Cosmos DB account by restoring only selected databases and containers from an existing database account
431431

432-
```azurecli-interactive
432+
```azurecli-interactive
433433
434-
az cosmosdb restore \
435-
--resource-group MyResourceGroup \
436-
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
437-
--account-name MySourceAccount \
438-
--restore-timestamp 2020-07-13T16:03:41+0000 \
439-
--location "West US" \
440-
--databases-to-restore name=MyDB1 collections=Collection1 Collection2 \
441-
--databases-to-restore name=MyDB2 collections=Collection3 Collection4
434+
az cosmosdb restore \
435+
--resource-group MyResourceGroup \
436+
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
437+
--account-name MySourceAccount \
438+
--restore-timestamp 2020-07-13T16:03:41+0000 \
439+
--location "West US" \
440+
--databases-to-restore name=MyDB1 collections=Collection1 Collection2 \
441+
--databases-to-restore name=MyDB2 collections=Collection3 Collection4
442442
443-
```
443+
```
444444
#### Create a new Azure Cosmos DB API for Gremlin account by restoring only selected databases and graphs from an existing API for Gremlin account
445445

446-
```azurecli-interactive
446+
```azurecli-interactive
447447
448-
az cosmosdb restore \
449-
--resource-group MyResourceGroup \
450-
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
451-
--account-name MySourceAccount \
452-
--restore-timestamp 2022-04-13T16:03:41+0000 \
453-
--location "West US" \
454-
--gremlin-databases-to-restore name=MyDB1 graphs=graph1 graph2 \
455-
--gremlin-databases-to-restore name=MyDB2 graphs =graph3 graph4
456-
```
448+
az cosmosdb restore \
449+
--resource-group MyResourceGroup \
450+
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
451+
--account-name MySourceAccount \
452+
--restore-timestamp 2022-04-13T16:03:41+0000 \
453+
--location "West US" \
454+
--gremlin-databases-to-restore name=MyDB1 graphs=graph1 graph2 \
455+
--gremlin-databases-to-restore name=MyDB2 graphs =graph3 graph4
456+
```
457457

458458
#### Create a new Azure Cosmos DB API for Table account by restoring only selected tables from an existing API for Table account
459459

460-
```azurecli-interactive
460+
```azurecli-interactive
461461
462-
az cosmosdb restore \
463-
--resource-group MyResourceGroup \
464-
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
465-
--account-name MySourceAccount \
466-
--restore-timestamp 2022-04-14T06:03:41+0000 \
467-
--location "West US" \
468-
--tables-to-restore table1 table2
469-
```
462+
az cosmosdb restore \
463+
--resource-group MyResourceGroup \
464+
--target-database-account-name MyRestoredCosmosDBDatabaseAccount \
465+
--account-name MySourceAccount \
466+
--restore-timestamp 2022-04-14T06:03:41+0000 \
467+
--location "West US" \
468+
--tables-to-restore table1 table2
469+
```
470470

471471
### <a id="get-the-restore-details-cli"></a>Get the restore details from the restored account
472472

@@ -664,6 +664,8 @@ az cosmosdb mongodb restorable-resource list \
664664

665665

666666

667+
668+
667669
#### List all the versions of databases in a live database account
668670
The enumeration commands described below help you discover the resources that are available for restore at various timestamps. Additionally, they also provide a feed of key events on the restorable account, database, and graph resources. These commands only work for live accounts.
669671

@@ -689,7 +691,7 @@ This command output now shows when a database was created and deleted.
689691
690692
}
691693
]
692-
```
694+
```
693695

694696
#### List all the versions of Gremlin graphs of a database in a live database account
695697

@@ -716,7 +718,7 @@ This command output shows includes list of operations performed on all the conta
716718
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGraphs"
717719
}
718720
]
719-
```
721+
```
720722

721723
#### Find databases or graphs that can be restored at any given timestamp
722724

@@ -817,7 +819,7 @@ Use the following ARM template to restore an account for the Azure Cosmos DB API
817819
{
818820
"name": "vinhpitrarmrestore-kal3",
819821
"type": "Microsoft.DocumentDB/databaseAccounts",
820-
"apiVersion": "2022-02-15-preview",
822+
"apiVersion": "2023-04-15",
821823
"location": "West US",
822824
"properties": {
823825
"locations": [
@@ -848,7 +850,7 @@ Use the following ARM template to restore an account for the Azure Cosmos DB API
848850
{
849851
"name": "ademo-pitr1",
850852
"type": "Microsoft.DocumentDB/databaseAccounts",
851-
"apiVersion": "2022-02-15-preview",
853+
"apiVersion": "2023-04-15",
852854
"location": "West US",
853855
"properties": {
854856
"locations": [
@@ -888,7 +890,7 @@ Use the following ARM template to restore an account for the Azure Cosmos DB API
888890
{
889891
"name": "ademo-pitr1",
890892
"type": "Microsoft.DocumentDB/databaseAccounts",
891-
"apiVersion": "2022-02-15-preview",
893+
"apiVersion": "2023-04-15",
892894
"location": "West US",
893895
"properties": {
894896
"locations": [
@@ -927,3 +929,5 @@ az deployment group create -g <ResourceGroup> --template-file <RestoreTemplateFi
927929
* [How to migrate to an account from periodic backup to continuous backup](migrate-continuous-backup.md).
928930
* [Continuous backup mode resource model.](continuous-backup-restore-resource-model.md)
929931
* [Manage permissions](continuous-backup-restore-permissions.md) required to restore data with continuous backup mode.
932+
933+

0 commit comments

Comments
 (0)