{
  "schema_version": 2,
  "id": "operate/rs/references/cli-utilities/rladmin/migrate",
  "title": "rladmin migrate",
  "url": "https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/migrate/",
  "summary": "Moves Redis Software shards or endpoints to a new node in the same cluster.",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2026-09-24T10:14:21+01:00",
  "page_type": "content",
  "content_hash": "156e9612d3a2b3a74847d6f3dd1572df7c8d92d1825d557dd5d80815d6ce5fd9",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Moves Redis Software shards or endpoints to a new node in the same cluster.\n\nFor more information about shard migration use cases and considerations, see [Migrate database shards](https://redis.io/docs/latest/operate/rs/databases/migrate-shards)."
    },
    {
      "id": "migrate-all_master_shards",
      "title": "`migrate all_master_shards`",
      "role": "content",
      "text": "Moves all primary shards of a specified database or node to a new node in the same cluster.\n\n[code example]"
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| db                            | db:\\<id\\><br /> name   | Limits migration to a specific database                                           |\n| node                          | integer                | Limits migration to a specific origin node                                        |\n| target_node                   | integer                | Migration target node                                                           |\n| override_policy               |                        | Overrides the rack aware policy and allows primary and replica shards on the same node |"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "Returns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/status#status-shards) to verify the migration completed."
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "migrate-all_shards",
      "title": "`migrate all_shards`",
      "role": "content",
      "text": "Moves all shards on a specified node to a new node in the same cluster.\n\n[code example]"
    },
    {
      "id": "parameters-1",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| node                          | integer                | Limits migration to a specific origin node                                        |\n| max_concurrent_bdb_migrations | integer                | Sets the maximum number of concurrent endpoint migrations                           |\n| override_policy               |                        | Overrides the rack aware policy and allows primary and replica shards on the same node |"
    },
    {
      "id": "returns-1",
      "title": "Returns",
      "role": "returns",
      "text": "Returns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/status#status-shards) to verify the migration completed."
    },
    {
      "id": "example-1",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "migrate-all_slave_shards",
      "title": "`migrate all_slave_shards`",
      "role": "content",
      "text": "Moves all replica shards of a specified database or node to a new node in the same cluster.\n\n[code example]"
    },
    {
      "id": "parameters-2",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| db                            | db:\\<id\\><br /> name   | Limits migration to a specific database                                           |\n| node                          | integer                | Limits migration to a specific origin node                                        |\n| target_node                   | integer                | Migration target node                                                           |\n| override_policy               |                        | Overrides the rack aware policy and allows primary and replica shards on the same node |"
    },
    {
      "id": "returns-2",
      "title": "Returns",
      "role": "returns",
      "text": "Returns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/status#status-shards) to verify the migration completed."
    },
    {
      "id": "example-2",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "migrate-endpoint_to_shards",
      "title": "`migrate endpoint_to_shards`",
      "role": "content",
      "text": "Moves database endpoints to the node where the majority of primary shards are located.\n\n[code example]"
    },
    {
      "id": "parameters-3",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| db                            | db:\\<id\\><br /> name   | Limits migration to a specific database                                           |\n| restrict_target_node          | integer | Moves the endpoint only if the target node matches the specified node |\n| commit                        |                        | Performs endpoint movement                                                      |\n| max_concurrent_bdb_migrations | integer                | Sets the maximum number of concurrent endpoint migrations                           |"
    },
    {
      "id": "returns-3",
      "title": "Returns",
      "role": "returns",
      "text": "Returns a list of steps to perform the migration. If the `commit` flag is set, the steps will run and return `Finished successfully` if they were completed. Otherwise, returns an error.\n\nUse [`rladmin status endpoints`](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/status#status-endpoints) to verify that the endpoints were moved."
    },
    {
      "id": "example-3",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "migrate-shard",
      "title": "`migrate shard`",
      "role": "content",
      "text": "Moves one or more shards to a new node in the same cluster.\n\n[code example]"
    },
    {
      "id": "parameters-4",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| shard                         | list of shard IDs      | Shards to migrate                                                               |\n| preserve_roles                |                        | Performs an additional failover to guarantee the primary shards' roles are preserved |\n| target_node                   | integer                | Migration target node                                                           |\n| override_policy               |                        | Overrides the rack aware policy and allows primary and replica shards on the same node |"
    },
    {
      "id": "returns-4",
      "title": "Returns",
      "role": "returns",
      "text": "Returns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`](https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/status#status-shards) to verify the migration completed."
    },
    {
      "id": "example-4",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "migrate-all_master_shards-ex0",
      "language": "sh",
      "code": "rladmin migrate { db { db:<id> | <name> } | node <origin node ID> }\n        all_master_shards\n        target_node <id>\n        [ override_policy ]",
      "section_id": "migrate-all_master_shards"
    },
    {
      "id": "example-ex0",
      "language": "sh",
      "code": "$ rladmin status shards db db:6 sort ROLE\nSHARDS:\nDB:ID  NAME       ID         NODE    ROLE    SLOTS         USED_MEMORY   STATUS\ndb:6   tr02       redis:14   node:3  master  0-4095        3.01MB        OK     \ndb:6   tr02       redis:16   node:3  master  4096-8191     3.2MB         OK     \ndb:6   tr02       redis:18   node:3  master  8192-12287    3.2MB         OK     \ndb:6   tr02       redis:20   node:3  master  12288-16383   3.01MB        OK\n$ rladmin migrate db db:6 all_master_shards target_node 1\nMonitoring 8b0f28e2-4342-427a-a8e3-a68cba653ffe\nqueued - migrate_shards\nrunning - migrate_shards\nExecuting migrate_redis with shards_uids ['18', '14', '20', '16']\nOcompleted - migrate_shards\nDone\n$ rladmin status shards node 1\nSHARDS:\nDB:ID  NAME       ID         NODE    ROLE    SLOTS         USED_MEMORY   STATUS\ndb:6   tr02       redis:14   node:1  master  0-4095        3.22MB        OK     \ndb:6   tr02       redis:16   node:1  master  4096-8191     3.22MB        OK     \ndb:6   tr02       redis:18   node:1  master  8192-12287    3.22MB        OK     \ndb:6   tr02       redis:20   node:1  master  12288-16383   2.99MB        OK",
      "section_id": "example"
    },
    {
      "id": "migrate-all_shards-ex0",
      "language": " sh",
      "code": "rladmin migrate node <origin node ID>\n            [ max_concurrent_bdb_migrations <value> ]\n            all_shards\n            target_node <id>\n            [ override_policy ]",
      "section_id": "migrate-all_shards"
    },
    {
      "id": "example-1-ex0",
      "language": "sh",
      "code": "$ rladmin status shards node 1\nSHARDS:\nDB:ID  NAME       ID         NODE    ROLE    SLOTS         USED_MEMORY   STATUS\ndb:5   tr01       redis:12   node:1  master  0-16383       3.04MB        OK\ndb:6   tr02       redis:15   node:1  slave   0-4095        2.93MB        OK\ndb:6   tr02       redis:17   node:1  slave   4096-8191     2.93MB        OK\ndb:6   tr02       redis:19   node:1  slave   8192-12287    3.08MB        OK\ndb:6   tr02       redis:21   node:1  slave   12288-16383   3.08MB        OK\n$ rladmin migrate node 1 all_shards target_node 2\nMonitoring 71a4f371-9264-4398-a454-ce3ff4858c09\nqueued - migrate_shards\n.running - migrate_shards\nExecuting migrate_redis with shards_uids ['21', '15', '17', '19']\nOExecuting migrate_redis with shards_uids ['12']\nOcompleted - migrate_shards\nDone\n$ rladmin status shards node 2\nSHARDS:\nDB:ID  NAME       ID         NODE    ROLE    SLOTS         USED_MEMORY   STATUS\ndb:5   tr01       redis:12   node:2  master  0-16383       3.14MB        OK\ndb:6   tr02       redis:15   node:2  slave   0-4095        2.96MB        OK\ndb:6   tr02       redis:17   node:2  slave   4096-8191     2.96MB        OK\ndb:6   tr02       redis:19   node:2  slave   8192-12287    2.96MB        OK\ndb:6   tr02       redis:21   node:2  slave   12288-16383   2.96MB        OK",
      "section_id": "example-1"
    },
    {
      "id": "migrate-all_slave_shards-ex0",
      "language": "sh",
      "code": "rladmin migrate { db { db:<id> | <name> } | node <origin node ID> }\n            all_slave_shards\n            target_node <id>\n            [ override_policy ]",
      "section_id": "migrate-all_slave_shards"
    },
    {
      "id": "example-2-ex0",
      "language": "sh",
      "code": "$ rladmin status shards db db:6 node 2\nSHARDS:\nDB:ID  NAME      ID         NODE    ROLE   SLOTS          USED_MEMORY    STATUS\ndb:6   tr02      redis:15   node:2  slave  0-4095         3.06MB         OK\ndb:6   tr02      redis:17   node:2  slave  4096-8191      3.06MB         OK\ndb:6   tr02      redis:19   node:2  slave  8192-12287     3.06MB         OK\ndb:6   tr02      redis:21   node:2  slave  12288-16383    3.06MB         OK\n$ rladmin migrate db db:6 all_slave_shards target_node 3\nMonitoring 5d36a98c-3dc8-435f-8ed9-35809ba017a4\nqueued - migrate_shards\n.running - migrate_shards\nExecuting migrate_redis with shards_uids ['15', '17', '21', '19']\nOcompleted - migrate_shards\nDone\n$ rladmin status shards db db:6 node 3\nSHARDS:\nDB:ID  NAME      ID         NODE    ROLE   SLOTS          USED_MEMORY    STATUS\ndb:6   tr02      redis:15   node:3  slave  0-4095         3.04MB         OK\ndb:6   tr02      redis:17   node:3  slave  4096-8191      3.04MB         OK\ndb:6   tr02      redis:19   node:3  slave  8192-12287     3.04MB         OK\ndb:6   tr02      redis:21   node:3  slave  12288-16383    3.04MB         OK",
      "section_id": "example-2"
    },
    {
      "id": "migrate-endpoint_to_shards-ex0",
      "language": "sh",
      "code": "rladmin migrate [ db { db:<id> | <name> } ]\n            endpoint_to_shards\n            [ restrict_target_node <id> ]\n            [ commit ]\n            [ max_concurrent_bdb_migrations <value> ]",
      "section_id": "migrate-endpoint_to_shards"
    },
    {
      "id": "example-3-ex0",
      "language": "sh",
      "code": "$ rladmin status endpoints db db:6\nENDPOINTS:\nDB:ID    NAME   ID                 NODE      ROLE                       SSL     \ndb:6     tr02   endpoint:6:1       node:3    all-master-shards          No      \n$ rladmin migrate db db:6 endpoint_to_shards\n* Going to bind endpoint:6:1 to node 1\nDry-run completed, add 'commit' argument to execute\n$ rladmin migrate db db:6 endpoint_to_shards commit\n* Going to bind endpoint:6:1 to node 1\nExecuting bind endpoint:6:1: OOO.\nFinished successfully\n$ rladmin status endpoints db db:6\nENDPOINTS:\nDB:ID    NAME   ID                 NODE      ROLE                       SSL     \ndb:6     tr02   endpoint:6:1       node:1    all-master-shards          No",
      "section_id": "example-3"
    },
    {
      "id": "migrate-shard-ex0",
      "language": "sh",
      "code": "rladmin migrate shard <id1.. idN>\n            [ preserve_roles ]\n            target_node <id>\n            [ override_policy ]",
      "section_id": "migrate-shard"
    },
    {
      "id": "example-4-ex0",
      "language": "sh",
      "code": "$ rladmin status shards db db:5\nSHARDS:\nDB:ID  NAME        ID         NODE     ROLE     SLOTS     USED_MEMORY    STATUS\ndb:5   tr01        redis:12   node:2   master   0-16383   3.01MB         OK\ndb:5   tr01        redis:13   node:3   slave    0-16383   3.1MB          OK\n$ rladmin migrate shard 13 target_node 1\nMonitoring d2637eea-9504-4e94-a70c-76df087efcb2\nqueued - migrate_shards\n.running - migrate_shards\nExecuting migrate_redis with shards_uids ['13']\nOcompleted - migrate_shards\nDone\n$ rladmin status shards db db:5\nSHARDS:\nDB:ID  NAME        ID         NODE     ROLE     SLOTS     USED_MEMORY    STATUS\ndb:5   tr01        redis:12   node:2   master   0-16383   3.01MB         OK\ndb:5   tr01        redis:13   node:1   slave    0-16383   3.04MB         OK",
      "section_id": "example-4"
    }
  ]
}
