{
  "id": "upgrade",
  "title": "Upgrade module requests",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/modules/upgrade/",
  "summary": "Upgrade module requests",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [POST](#post-modules-upgrade-bdb) | `/v1/modules/upgrade/bdb/{uid}` | Upgrade module |\n\n## Upgrade module {#post-modules-upgrade-bdb}\n\n\tPOST /v1/modules/upgrade/bdb/{string: uid}\n\nUpgrades the module version on a specific database. Deprecated as of Redis Enterprise Software v7.8.2. Use [`POST /v1/bdbs/\u003cuid\u003e/upgrade`]() instead.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [edit_bdb_module]() |\n\n### Request {#post-request} \n\n#### Example HTTP request\n\n\tPOST /v1/modules/upgrade/bdb/1\n\n#### Example JSON body\n\n```json\n{\n     \"modules\": [\n         {\"module_name\": \"ReJson\",\n         \"current_semantic_version\": \"2.2.1\",\n         \"new_module\": \"aa3648d79bd4082d414587c42ea0b234\"}\n     ],\n     \"// Optional fields to fine-tune restart and failover behavior:\",\n     \"preserve_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\n#### Request body\n\n| Field | Type | Description |\n|-------|------|-------------|\n| modules | list | List of dicts representing the modules that will be upgraded. Each dict must include: \u003cbr\u003e\u003c/br\u003e • **current_module**: UID of a module to upgrade \u003cbr\u003e\u003c/br\u003e • **new_module**: UID of the module we want to upgrade to \u003cbr\u003e\u003c/br\u003e • **new_module_args**: args list for the new module |\n| preserve_roles | boolean | Preserve shards’ master/replica roles (optional) |\n| may_discard_data | boolean | Discard data in a non-replicated non-persistent database (optional) |\n\n### Response {#post-response} \n\nReturns the upgraded [module object]().\n\n#### Example JSON body\n\n```json\n{\n    \"uid\": 1,\n    \"name\": \"name of database #1\",\n    \"module_id\": \"aa3648d79bd4082d414587c42ea0b234\",\n    \"module_name\": \"ReJson\",\n    \"semantic_version\": \"2.2.2\"\n    \"// additional fields...\"\n}\n```\n\n### Error codes {#post-error-codes} \n\nWhen errors are reported, the server may return a JSON object with    `error_code` and `message` field that provide additional information.    The following are possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| missing_module | Module is not present in cluster.| \n| module_downgrade_unsupported | Module downgrade is not allowed.| \n| redis_incompatible_version | Module min_redis_version is bigger than the current Redis version.| \n| redis_pack_incompatible_version | Module min_redis_pack_version is bigger than the current Redis Enterprise version.| \n| unsupported_module_capabilities | New version of module does support all the capabilities needed for the database configuration| \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, module updated on bdb. |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | bdb or node not found. |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing configuration parameters. |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | The requested configuration is invalid. |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "0001-01-01T00:00:00Z"
}

