{
  "schema_version": 2,
  "id": "operate/rs/references/cli-utilities/rladmin/upgrade",
  "title": "rladmin upgrade",
  "url": "https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/upgrade/",
  "summary": "Upgrades a database's Redis version and modules.",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2026-09-24T10:14:21+01:00",
  "page_type": "content",
  "content_hash": "0a0b2f02848f2206c9460bd447c885605c517881e4c9e8f484103dad6877fb74",
  "sections": [
    {
      "id": "upgrade-db",
      "title": "`upgrade db`",
      "role": "overview",
      "text": "Schedules a restart of the primary and replica processes of a database and then upgrades the database to the latest version of Redis.\n\nFor more information, see [Upgrade an existing Redis Software Deployment](https://redis.io/docs/latest/operate/rs/installing-upgrading/upgrading).\n\n[code example]\n\nAs of v6.2.4, the default behavior for `upgrade db` has changed.  It is now controlled by a new parameter that sets the default upgrade policy used to create new databases and to upgrade ones already in the cluster.  To learn more, see [`tune cluster default_redis_version`](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/tune#tune-cluster).\n\nAs of Redis Software version 7.8.2, `upgrade db` will always upgrade modules."
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Parameters                 | Type/Value               | Description                                                                                                            |\n|----------------------------|--------------------------|------------------------------------------------------------------------------------------------------------------------|\n| db                         | db:\\<id\\> <br />name     | Database to upgrade                                                                                                    |\n| and module | [upgrade module](#upgrade-module) command | Clause that allows the upgrade of a database and a specified Redis module in a single step with only one restart (can be specified multiple times). Deprecated as of Redis Software v7.8.2.  |\n| discard_data               |                          | Indicates that data will not be saved after the upgrade                                                                |\n| force                      |                          | Forces upgrade and skips warnings and confirmations                                                                    |\n| force_discard              |                          | Forces `discard_data` if replication or persistence is enabled                                                   |\n| keep_crdt_protocol_version |                          | Keeps the current CRDT protocol version                                                                                |\n| keep_redis_version       |                          | Upgrades to a new patch release, not to the latest major.minor version. Deprecated as of Redis Software v7.8.2. To upgrade modules without upgrading the Redis database version, set `redis_version` to the current Redis database version instead. |\n| parallel_shards_upgrade    | integer <br />'all'        | Maximum number of shards to upgrade all at once                                                                        |\n| preserve_roles             |                          | Performs an additional failover to guarantee the shards' roles are preserved                                             |\n| redis_version              | Redis version            | Upgrades the database to the specified version instead of the latest version                                               |"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "Returns `Done` if the upgrade completed. Otherwise, it returns an error."
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "upgrade-db-ex0",
      "language": "sh",
      "code": "rladmin upgrade db { db:<id> | <name> }\n                [ preserve_roles ]\n                [ keep_redis_version ]\n                [ discard_data ]\n                [ force_discard ]\n                [ parallel_shards_upgrade ]\n                [ keep_crdt_protocol_version ]\n                [ redis_version <version> ]\n                [ force ]\n                [ and module module_name <module name> version <version> module_args <arguments string> ]",
      "section_id": "upgrade-db"
    },
    {
      "id": "example-ex0",
      "language": "sh",
      "code": "$ rladmin upgrade db db:5\nMonitoring e39c8e87-75f9-4891-8c86-78cf151b720b\nactive - SMUpgradeBDB init\nactive - SMUpgradeBDB check_slaves\n.active - SMUpgradeBDB prepare\nactive - SMUpgradeBDB stop_forwarding\noactive - SMUpgradeBDB start_wd\nactive - SMUpgradeBDB wait_for_version\n.completed - SMUpgradeBDB\nDone",
      "section_id": "example"
    }
  ]
}
