Skip to content

Commit 52ac555

Browse files
committed
Address eng and PM comments
1 parent 20e636b commit 52ac555

File tree

4 files changed

+55
-39
lines changed

4 files changed

+55
-39
lines changed

src/current/_includes/cockroachcloud/backups/cloud-api-backup-settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Set the following:
1414
- `{cluster_id}` is the unique ID of the cluster. Use this ID when making API requests. You can find the cluster ID in the cluster's Cloud Console page. Find your cluster ID in the URL of the single cluster overview page: `https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview`. The ID should resemble `f78b7feb-b6cf-4396-9d7f-494982d7d81e`.
1515
- `{secret_key}` is your API key. Refer to [API Access]({% link cockroachcloud/managing-access.md %}#api-access) for more details.
1616

17-
If the request was successful, the API will return details about the managed backup settings:
17+
If the request is successful, the API will return details about the managed backup settings:
1818

1919
~~~json
2020
{
@@ -53,7 +53,7 @@ Set the following:
5353
- `{frequency_minutes}` determines [how often](#frequency) the managed backup will run in minutes. Possible values are: `5`, `10`, `15`, `30`, `60`, `240` (4 hours), `1440` (24 hours).
5454
- `{retention_days}` sets the number of days Cockroach Labs will [retain](#retention) the managed backup in storage. You can change `retention_days` for the cluster **once** (whether in the Cloud API or [Cloud Console](#cloud-console)). Possible values are: `2`, `7`, `30`, `90`, `365`.
5555

56-
If `{retention_days}` has previously been modified (in the Cloud API or Cloud Console), you will receive the message "cluster already has a retention policy set, open a support ticket to change it". To modify the setting again, contact the [Cockroach Labs Support team]({% link {{site.current_cloud_version}}/support-resources.md %}).
56+
If `{retention_days}` has previously been modified (in the Cloud API or Cloud Console), you receive the message "cluster already has a retention policy set, open a support ticket to change it". To modify the setting again, contact the [Cockroach Labs Support team]({% link {{site.current_cloud_version}}/support-resources.md %}).
5757
- `{secret_key}` is your API key. Refer to [API Access]({% link cockroachcloud/managing-access.md %}#api-access) for more details.
5858

59-
If the request was successful, the client will receive an empty HTTP 200 OK status response.
59+
If the request is successful, the client recieves an empty HTTP 200 OK status response.

src/current/_includes/cockroachcloud/backups/cloud-api-backup-view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ curl --request GET \
99
--header 'Authorization: Bearer {secret_key}' \
1010
~~~
1111

12-
If the request was successful, the client will receive a JSON response listing backups with their unique `{id}` and `{as_of_time}` creation timestamp:
12+
If the request is successful, the client recieves a JSON response listing backups with their unique `{id}`. The `{as_of_time}` timestamp describes the system time of the cluster when the backup was created:
1313

1414
~~~ json
1515
{

src/current/_includes/cockroachcloud/backups/cloud-api-managed-backup-intro.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{% if page.name == "managed-backups-basic.md" %}
2-
You can use the [CockroachDB Cloud API]({% link cockroachcloud/cloud-api.md %}) to [view managed backups](#view-managed-backups) or [restore clusters/databases/tables](#restore-from-a-managed-backup) from a managed backup.
2+
You can use the [CockroachDB Cloud API]({% link cockroachcloud/cloud-api.md %}) to [view managed backups](#view-managed-backups) or [restore clusters](#restore-from-a-managed-backup) from a managed backup.
3+
{% else if page.name == "managed-backups.md" %}
4+
You can use the [CockroachDB Cloud API]({% link cockroachcloud/cloud-api.md %}) to [view](#get-information-on-backup-settings) and [modify managed backup settings](#modify-backup-settings-on-a-cluster), [view managed backups](#view-managed-backups), or [restore clusters](#restore-from-a-managed-backup) from a managed backup.
35
{% else %}
46
You can use the [CockroachDB Cloud API]({% link cockroachcloud/cloud-api.md %}) to [view](#get-information-on-backup-settings) and [modify managed backup settings](#modify-backup-settings-on-a-cluster), [view managed backups](#view-managed-backups), or [restore clusters/databases/tables](#restore-from-a-managed-backup) from a managed backup.
57
{% endif %}

src/current/_includes/cockroachcloud/backups/cloud-api-restore-endpoint.md

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
### Restore from a managed backup
22

3-
You can use the `/v1/clusters/{cluster_id}/restores` endpoint to restore the contents of a managed backup at the cluster, database, or table level.
3+
You can use the `/v1/clusters/{destination_cluster_id}/restores` endpoint to restore the contents of a managed backup to a specified destination cluster.
44

55
{% if page.name == "managed-backups-advanced.md" %}
6-
On Advanced clusters, restore operations can be performed into the same cluster or a different Advanced cluster in the same organization.
6+
On Advanced clusters, restore operations can be performed at the cluster, database, or table level into the same cluster or a different Advanced cluster in the same organization.
77
{% else %}
8-
On Standard and Basic clusters, restore operations can only be performed into the same cluster where the managed backup is stored.
8+
On Standard and Basic clusters, restore operations can only be performed into the same cluster where the managed backup is stored. Managed backups can only be restored at the cluster level.
99
{% endif %}
1010

1111
#### Restore a cluster
1212

13-
{{site.data.alerts.callout_danger}}
14-
The restore operation completely erases all data in the destination cluster. All cluster data is replaced with the data from the backup. The destination cluster will be unavailable while the job is in progress.
15-
16-
This operation is disruptive and is to be performed with caution. Use the [Principle of Least Privilege (PoLP)](https://wikipedia.org/wiki/Principle_of_least_privilege) as a golden rule when designing your system of privilege grants.
13+
{{site.data.alerts.callout_info}}
14+
Before a cluster can be restored from a managed backup, the destination cluster must be completely wiped of data. A cluster restore operation fails if the destination cluster contains any databases/schemas/tables.
1715
{{site.data.alerts.end}}
1816

19-
To restore a managed backup of a cluster, send a `POST` request to the `/v1/clusters/{cluster_id}/restores` endpoint of `"type": "CLUSTER"`:
17+
To restore a cluster to a recent managed backup, send a `POST` request to the `/v1/clusters/{cluster_id}/restores` endpoint of `"type": "CLUSTER"`:
2018

2119
{% include_cached copy-clipboard.html %}
2220
~~~ shell
2321
curl --request POST \
2422
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
2523
--header "Authorization: Bearer {secret_key}" \
2624
--json '{
25+
"source_cluster_id": "{cluster_id}"
2726
"type": "CLUSTER"
2827
}'
2928
~~~
3029

31-
By default the restore operation will use the most recent backup. To restore a specific backup, include the `backup_id` field specifying a backup ID:
30+
By default, the restore operation uses the most recent backup stored within the last 7 days on the cluster specified in `source_cluster_id`. To restore a specific backup, include the `backup_id` field and specify a backup ID from the [managed backups list](#view-managed-backups):
3231

3332
{% include_cached copy-clipboard.html %}
3433
~~~ shell
@@ -42,12 +41,12 @@ curl --request POST \
4241
~~~
4342

4443
{% if page.name == "managed-backups-advanced.md" %}
45-
To restore a cluster backup into a new cluster, first create the target cluster. Send the restore request to the target cluster ID, specifying the ID of the source cluster as `source_cluster_id`. Both the source cluster and the target cluster must use the Advanced plan.
44+
To restore a cluster backup into a different cluster, ensure that the destination cluster is created and contains no databases/schemas/tables. Send the restore request to the destination cluster ID, specifying the ID of the source cluster as `source_cluster_id`. Both the source cluster and the destination cluster must use the Advanced plan.
4645

4746
{% include_cached copy-clipboard.html %}
4847
~~~ shell
4948
curl --request POST \
50-
--url 'https://cockroachlabs.cloud/api/v1/clusters/{target_cluster_id}/restores' \
49+
--url 'https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores' \
5150
--header "Authorization: Bearer {secret_key}" \
5251
--json '{
5352
"source_cluster_id": "{source_cluster_id}",
@@ -56,9 +55,9 @@ curl --request POST \
5655
~~~
5756
{% endif %}
5857

59-
You can specify additional options for the restore operations in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
58+
You can specify additional options for the restore operation in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
6059

61-
If the request was successful, the client will receive a response containing JSON describing the request operation:
60+
If the request is successful, the client recieves a JSON response that describes the request operation:
6261

6362
~~~ json
6463
{
@@ -67,37 +66,43 @@ If the request was successful, the client will receive a response containing JSO
6766
"status": "PENDING",
6867
"created_at": "2025-07-25T16:45:14.064208710Z",
6968
"type": "CLUSTER",
70-
"completion_percent": 0
69+
"completion_percent": 1
7170
}
7271
~~~
7372

73+
{% if page.name == "managed-backups-advanced.md" %}
7474
#### Restore a database
7575

76-
To restore a database from a managed backup to a cluster, send a `POST` request to the `/v1/clusters/{cluster_id}/restores` endpoint of `"type": "DATABASE"`. Specify the name of the source database in `objects.database`:
76+
To restore one or more databases from a cluster's managed backup, send a `POST` request to the `/v1/clusters/{cluster_id}/restores` endpoint of `"type": "DATABASE"`. Specify the name of the databases in `objects`:
7777

7878
{% include_cached copy-clipboard.html %}
7979
~~~ shell
8080
curl --request POST \
8181
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
8282
--header "Authorization: Bearer {secret_key}" \
8383
--json '{
84+
"source_cluster_id": "{cluster_id}"
8485
"type": "DATABASE",
8586
"objects": [
8687
{
8788
"database": "tpcc"
89+
},
90+
{
91+
"database": "movr"
8892
}
8993
]
9094
}'
9195
~~~
9296

93-
By default the database will be restored into the original database name from the managed backup. To restore the database contents into a new database, include the field `restore_opts.new_db_name` with the new database name:
97+
By default, the database is restored into the original database name from the managed backup. To restore the database contents into a new database, include the field `restore_opts.new_db_name` with the new database name. You can only restore one database at a time when using this option.
9498

9599
{% include_cached copy-clipboard.html %}
96100
~~~ shell
97101
curl --request POST \
98102
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
99103
--header "Authorization: Bearer {secret_key}" \
100104
--json '{
105+
"source_cluster_id": "{cluster_id}"
101106
"type": "DATABASE",
102107
"objects": [
103108
{
@@ -128,13 +133,12 @@ curl --request POST \
128133
}'
129134
~~~
130135

131-
{% if page.name == "managed-backups-advanced.md" %}
132-
To restore a database from a managed backup into a different cluster, send the restore request to the target cluster ID. Specify the ID of the backup's cluster as `source_cluster_id`. Both the source cluster and the target cluster must use the Advanced plan.
136+
To restore a database from a source cluster's managed backup into a different cluster, send the restore request to the destination cluster ID. Specify the ID of the backup's cluster as `source_cluster_id`. Both the source cluster and the destination cluster must use the Advanced plan.
133137

134138
{% include_cached copy-clipboard.html %}
135139
~~~ shell
136140
curl --request POST \
137-
--url 'https://cockroachlabs.cloud/api/v1/clusters/{target_cluster_id}/restores' \
141+
--url 'https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores' \
138142
--header "Authorization: Bearer {secret_key}" \
139143
--json '{
140144
"source_cluster_id": "{source_cluster_id}",
@@ -146,11 +150,10 @@ curl --request POST \
146150
],
147151
}'
148152
~~~
149-
{% endif %}
150153

151154
You can specify additional options for the restore operations in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
152155

153-
If the request was successful, the client will receive a response containing JSON describing the request operation:
156+
If the request is successful, the client recieves a response containing JSON describing the request operation:
154157

155158
~~~ json
156159
{
@@ -159,45 +162,57 @@ If the request was successful, the client will receive a response containing JSO
159162
"status": "PENDING",
160163
"created_at": "2025-07-25T16:45:14.064208710Z",
161164
"type": "DATABASE",
162-
"completion_percent": 0
165+
"completion_percent": 1
163166
}
164167
~~~
165168

166169
#### Restore a table
167170

168-
To restore a table from a managed backup to a cluster, send a `POST` request to the `/v1/clusters/{cluster_id}/restores` endpoint of `"type": "TABLE"`. Specify the fully qualified name of the source table in `objects`:
171+
To restore a one or more tables from a cluster's managed backup, send a `POST` request to the `/v1/clusters/{cluster_id}/restores` endpoint of `"type": "TABLE"`. Specify the fully qualified name of the source tables in `objects`:
169172

170173
{% include_cached copy-clipboard.html %}
171174
~~~ shell
172175
curl --request POST \
173176
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
174177
--header "Authorization: Bearer {secret_key}" \
175178
--json '{
179+
"source_cluster_id": "{cluster_id}"
176180
"type": "TABLE",
177181
"objects": [
178182
{
179183
"database": "tpcc",
180184
"schema": "public",
181185
"table": "warehouse"
186+
},
187+
{
188+
"database": "tpcc",
189+
"schema": "public",
190+
"table": "customer"
182191
}
183192
]
184193
}'
185194
~~~
186195

187-
By default the table will be restored into the original database name from the managed backup. To restore the table into a different database, include the field `restore_opts.into_name` with the desired database name. The following example restores the `tpcc.public.warehouse` table from the most recent managed backup into `tpcc2.public.warehouse` on the cluster:
196+
By default, the table is restored into the original database name from the managed backup. To restore the table into a different database, include the field `restore_opts.into_db` with the desired database name. The following example restores the `tpcc.public.warehouse` table from the most recent managed backup into `tpcc2.public.warehouse` on the cluster:
188197

189198
{% include_cached copy-clipboard.html %}
190199
~~~ shell
191200
curl --request POST \
192201
--url 'https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/restores' \
193202
--header "Authorization: Bearer {secret_key}" \
194203
--json '{
204+
"source_cluster_id": "{cluster_id}"
195205
"type": "TABLE",
196206
"objects": [
197207
{
198208
"database": "tpcc",
199209
"schema": "public",
200210
"table": "warehouse"
211+
},
212+
{
213+
"database": "tpcc",
214+
"schema": "public",
215+
"table": "customer"
201216
}
202217
],
203218
"restore_opts": {
@@ -226,13 +241,12 @@ curl --request POST \
226241
}'
227242
~~~
228243

229-
{% if page.name == "managed-backups-advanced.md" %}
230-
To restore a table from a managed backup into a different cluster, send the restore request to the target cluster ID. Specify the ID of the backup's cluster as `source_cluster_id`. Both the source cluster and the target cluster must use the Advanced plan.
244+
To restore a table from a source cluster's managed backup into a different cluster, send the restore request to the destination cluster ID. Specify the ID of the backup's cluster as `source_cluster_id`. Both the source cluster and the destination cluster must use the Advanced plan.
231245

232246
{% include_cached copy-clipboard.html %}
233247
~~~ shell
234248
curl --request POST \
235-
--url 'https://cockroachlabs.cloud/api/v1/clusters/{target_cluster_id}/restores' \
249+
--url 'https://cockroachlabs.cloud/api/v1/clusters/{destination_cluster_id}/restores' \
236250
--header "Authorization: Bearer {secret_key}" \
237251
--json '{
238252
"source_cluster_id": "{source_cluster_id}",
@@ -246,26 +260,26 @@ curl --request POST \
246260
]
247261
}'
248262
~~~
249-
{% endif %}
250263

251264
You can specify additional options for the restore operations in the `restore_opts` object. For more information, see the [API endpoint documentation](https://www.cockroachlabs.com/docs/api/cloud/v1#get-/api/v1/clusters/-cluster_id-/restores-config).
252265

253-
If the request was successful, the client will receive a response containing JSON describing the request operation:
266+
If the request is successful, the client recieves a response containing JSON describing the request operation:
254267

255268
~~~ json
256269
{
257270
"id": "example-aeb7-4daa-9e2c-eda541765f8a",
258271
"backup_id": "example-2d25-4a64-8172-28af7a0d41cc",
259272
"status": "PENDING",
260273
"created_at": "2025-07-25T16:45:14.064208710Z",
261-
"type": "table",
262-
"completion_percent": 0
274+
"type": "TABLE",
275+
"completion_percent": 1
263276
}
264277
~~~
278+
{% endif %}
265279

266280
### Get status of a restore operation
267281

268-
To view the status of a restore operation using the cloud API, send a `GET` request to the `/v1/clusters/{cluster_id}/restores/{restore_id}` endpoint:
282+
To view the status of a restore operation using the cloud API, send a `GET` request to the `/v1/clusters/{cluster_id}/restores/{restore_id}` endpoint where `restore_id` is the `id` from the JSON response:
269283

270284
{% include_cached copy-clipboard.html %}
271285
~~~ shell
@@ -274,7 +288,7 @@ curl --request GET \
274288
--header 'Authorization: Bearer {secret_key}' \
275289
~~~
276290

277-
If the request was successful, the client will receive a response containing JSON describing the status of the specified request operation:
291+
If the request is successful, the client recieves a response containing JSON describing the status of the specified request operation:
278292

279293
~~~ json
280294
{
@@ -283,6 +297,6 @@ If the request was successful, the client will receive a response containing JSO
283297
"status": "SUCCESS",
284298
"created_at": "2025-07-25T16:45:14.064208710Z",
285299
"type": "CLUSTER",
286-
"completion_percent": 100
300+
"completion_percent": 1
287301
}
288302
~~~

0 commit comments

Comments
 (0)