{
  "id": "migrate",
  "title": "rladmin migrate",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/cli-utilities/rladmin/migrate/",
  "summary": "Moves Redis Enterprise Software shards or endpoints to a new node in the same cluster.",
  "content": "\nMoves Redis Enterprise 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]().\n\n## `migrate all_master_shards`\n\nMoves all primary shards of a specified database or node to a new node in the same cluster.\n\n```sh\nrladmin migrate { db { db:\u003cid\u003e | \u003cname\u003e } | node \u003corigin node ID\u003e }\n        all_master_shards\n        target_node \u003cid\u003e\n        [ override_policy ]\n```\n\n### Parameters\n\n| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| db                            | db:\\\u003cid\\\u003e\u003cbr /\u003e 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 |\n\n### Returns\n\nReturns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`]() to verify the migration completed.\n\n### Example\n\n```sh\n$ 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  \n```\n## `migrate all_shards`\n\nMoves all shards on a specified node to a new node in the same cluster.\n\n``` sh\nrladmin migrate node \u003corigin node ID\u003e\n            [ max_concurrent_bdb_migrations \u003cvalue\u003e ]\n            all_shards\n            target_node \u003cid\u003e\n            [ override_policy ]\n```\n\n### Parameters\n\n| 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 |\n\n### Returns\n\nReturns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`]() to verify the migration completed.\n\n### Example\n\n```sh\n$ 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\n```\n\n## `migrate all_slave_shards`\n\nMoves all replica shards of a specified database or node to a new node in the same cluster.\n\n```sh\nrladmin migrate { db { db:\u003cid\u003e | \u003cname\u003e } | node \u003corigin node ID\u003e }\n            all_slave_shards\n            target_node \u003cid\u003e\n            [ override_policy ]\n```\n\n### Parameters\n\n| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| db                            | db:\\\u003cid\\\u003e\u003cbr /\u003e 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 |\n\n### Returns\n\nReturns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`]() to verify the migration completed.\n\n### Example\n\n```sh\n$ 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\n```\n\n## `migrate endpoint_to_shards`\n\nMoves database endpoints to the node where the majority of primary shards are located.\n\n```sh\nrladmin migrate [ db { db:\u003cid\u003e | \u003cname\u003e } ]\n            endpoint_to_shards\n            [ restrict_target_node \u003cid\u003e ]\n            [ commit ]\n            [ max_concurrent_bdb_migrations \u003cvalue\u003e ]\n```\n\n### Parameters\n\n| Parameter                     | Type/Value             | Description                                                                     |\n|-------------------------------|------------------------|---------------------------------------------------------------------------------|\n| db                            | db:\\\u003cid\\\u003e\u003cbr /\u003e 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                           |\n\n\n### Returns\n\nReturns 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`]() to verify that the endpoints were moved.\n\n### Example\n\n```sh\n$ 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      \n```\n\n## `migrate shard`\n\nMoves one or more shards to a new node in the same cluster.\n\n```sh\nrladmin migrate shard \u003cid1.. idN\u003e\n            [ preserve_roles ]\n            target_node \u003cid\u003e\n            [ override_policy ]\n```\n\n### Parameters\n\n| 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 |\n\n### Returns\n\nReturns `Done` if the migration completed successfully. Otherwise, returns an error.\n\nUse [`rladmin status shards`]() to verify the migration completed.\n\n### Example\n\n```sh\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: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\n```\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

