{
  "id": "recover",
  "title": "Recover database requests",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/bdbs/actions/recover/",
  "summary": "REST API requests for database recovery",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-bdbs-actions-recover) | `/v1/bdbs/{uid}/actions/recover` | Get database recovery plan  |\n| [POST](#post-bdbs-actions-recover) | `/v1/bdbs/{uid}/actions/recover` | Recover database  |\n\n## Get recovery plan {#get-bdbs-actions-recover}\n\n```sh\nGET /v1/bdbs/{int: uid}/actions/recover\n```\n\nFetches the recovery plan for a database. The recovery plan provides information about the recovery status, such as whether recovery is possible, and details on available files to use for recovery.\n\n#### Required permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_recovery_plan]() | admin\u003cbr /\u003ecluster_member\u003cbr /\u003ecluster_viewer\u003cbr /\u003edb_member\u003cbr /\u003edb_viewer |\n\n### Request {#get-request}\n\n#### Example HTTP request\n\n```sh\nGET /v1/bdbs/1/actions/recover\n```\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the database. |\n\n### Response {#get-response}\n\nReturns a JSON object that represents the database's recovery plan, including recovery files and status.\n\n#### Example response body\n\n```json\n{\n  \"data_files\": [\n    {\n      \"filename\": \"appendonly-1.aof\",\n      \"last_modified\": 1721164863.8883622,\n      \"node_uid\": \"1\",\n      \"shard_role\": \"master\",\n      \"shard_slots\": \"1-2048\",\n      \"shard_uid\": \"1\",\n      \"size\": 88\n    },\n    {\n      \"filename\": \"appendonly-2.aof\",\n      \"last_modified\": 1721164863.8883622,\n      \"node_uid\": \"2\",\n      \"shard_role\": \"slave\",\n      \"shard_slots\": \"2049-4096\",\n      \"shard_uid\": \"2\",\n      \"size\": 88\n    }\n  ],\n  \"status\": \"ready\"\n}\n```\n\n#### Status codes {#get-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | No error. |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | Database UID does not exist. |\n\n## Recover database {#post-bdbs-actions-recover}\n\n```sh\nPOST /v1/bdbs/{int: uid}/actions/recover\n```\n\nInitiates [recovery for a database]() in a recoverable state where all the database's files are available after [cluster recovery]().\n\n#### Required permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [start_bdb_recovery]() | admin\u003cbr /\u003ecluster_member\u003cbr /\u003edb_member |\n\n### Request {#post-request}\n\nThe request body can either be empty or include a recovery plan.\n\nIf the request body is empty, the database will be recovered automatically:\n\n- Databases with no persistence are recovered with no data.\n\n- Persistent files such as AOF or RDB will be loaded from their expected storage locations where replica or primary shards were last active.\n\n- If persistent files are not found where expected but can be located on other cluster nodes, they will be used.\n\n#### Example HTTP request\n\n```sh\nPOST /v1/bdbs/1/actions/recover\n```\n\n#### Example request body\n\n```json\n{\n  \"data_files\": [\n    {\n      \"filename\": \"appendonly-1.aof\",\n      \"node_uid\": \"1\",\n      \"shard_slots\": \"1-2048\"\n    },\n    {\n      \"filename\": \"appendonly-2.aof\",\n      \"node_uid\": \"2\",\n      \"shard_slots\": \"2049-4096\"\n    }\n  ],\n  \"ignore_errors\": false,\n  \"recover_without_data\": false\n}\n```\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the database to recover. |\n\n### Response {#post-response}\n\nReturns a status code. Also returns a JSON object with an `action_uid` in the request body if successful.\n\n#### Status codes {#post-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | The request is accepted and is being processed. When the database is recovered, its status will become `active`. |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | Attempting to perform an action on a nonexistent database. |\n| [409 Conflict](https://www.rfc-editor.org/rfc/rfc9110.html#name-409-conflict) | Database is currently busy with another action, recovery is already in progress, or is not in a recoverable state. |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

