{
  "id": "upgrade",
  "title": "Database upgrade requests",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/bdbs/upgrade/",
  "summary": "Database upgrade requests",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [POST](#post-bdbs-upgrade) | `/v1/bdbs/{uid}/upgrade` | Upgrade database |\n\n## Upgrade database {#post-bdbs-upgrade}\n\n\tPOST /v1/bdbs/{int: uid}/upgrade\n\nUpgrade a database.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [update_bdb_with_action]() |\n\n### Request {#post-request} \n\n#### Example HTTP request\n\n\tPOST /v1/bdbs/1/upgrade \n\n#### Example JSON body\n\n```json\n{\n    \"swap_roles\": true,\n    \"may_discard_data\": false\n}\n```\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### Request body\n\n| Field | Type | Description |\n|-------|------|-------------|\n| force_restart | boolean | Restart shards even if no version change (default: false) |\n| keep_redis_version | boolean | Keep current Redis version (default: false). Deprecated as of Redis Enterprise Software v7.8.2. To upgrade modules without upgrading the Redis database version, set `redis_version` to the current Redis database version instead. |\n| keep_crdt_protocol_version | boolean | Keep current crdt protocol version (default: false)  |\n| may_discard_data | boolean | Discard data in a non-replicated, non-persistent bdb (default: false) |\n| force_discard | boolean | Discard data even if the bdb is replicated and/or persistent (default: false) |\n| preserve_roles | boolean | Preserve shards' master/replica roles (requires an extra failover) (default: false) |\n| parallel_shards_upgrade | integer | Max number of shards to upgrade in parallel (default: all) |\n| modules | list of modules | List of dicts representing the modules that will be upgraded. As of Redis Enterprise Software v7.8.2, `current_module` and `new_module` are deprecated.\u003cbr\u003e\u003c/br\u003eEach dict includes:\u003cbr\u003e\u003c/br\u003e• `current_module`: uid of a module to upgrade (deprecated)\u003cbr\u003e\u003c/br\u003e• `new_module`: uid of the module we want to upgrade to (deprecated)\u003cbr\u003e\u003c/br\u003e• `new_module_args`: args list for the new module (no defaults for the three module-related parameters).\n| redis_version | version number | Upgrades the database to the specified Redis version instead of the latest version. To upgrade modules without upgrading the Redis database version, set `redis_version` to the current Redis database version instead. |\n| latest_with_modules | boolean | Upgrades the database to the latest Redis version and latest supported versions of modules available in the cluster. (default: true as of v7.8.2) Deprecated as of Redis Enterprise Software v7.8.2. |\n\n### Response {#post-response} \n\nReturns the upgraded [BDB object]().\n\n#### Example JSON body\n\n```json\n{\n    \"uid\": 1,\n    \"replication\": true,\n    \"data_persistence\": \"aof\",\n    \"// additional fields...\"\n}\n```\n\n### Status codes {#post-status-codes} \n\n| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, bdb upgrade initiated (`action_uid` can be used to track progress) |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Malformed or bad command |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | bdb not found |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | New module version capabilities don't comply with the database configuration |\n| [500 Internal Server Error](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1) | Internal error |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

