{"id":21678455,"url":"https://github.com/jc21/redis-migrator","last_synced_at":"2025-04-12T05:36:20.694Z","repository":{"id":42706488,"uuid":"337945133","full_name":"jc21/redis-migrator","owner":"jc21","description":"Redis Migrator will take the keys from one server/db and transfer them to another server/db","archived":false,"fork":false,"pushed_at":"2022-03-26T16:41:52.000Z","size":20,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T01:01:50.804Z","etag":null,"topics":["migrate","redis","redis-migrator"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jc21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-11T06:10:21.000Z","updated_at":"2023-06-01T10:04:02.000Z","dependencies_parsed_at":"2022-09-09T18:12:15.373Z","dependency_job_id":null,"html_url":"https://github.com/jc21/redis-migrator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jc21%2Fredis-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jc21%2Fredis-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jc21%2Fredis-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jc21%2Fredis-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jc21","download_url":"https://codeload.github.com/jc21/redis-migrator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248524650,"owners_count":21118612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["migrate","redis","redis-migrator"],"created_at":"2024-11-25T14:34:35.358Z","updated_at":"2025-04-12T05:36:20.657Z","avatar_url":"https://github.com/jc21.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis Migrator\n\nRedis Migrator will take the keys from one server/db and\ntransfer them to another server/db.\n\n## How does it work?\n\nSimply it iterates over the keys in SOURCE and recreates them on DESTINATION.\n\nThis will not wipe out any existing data in DESTINATION, with the exception\nof Lists which have to be replaced entirely on the DESTINATION. Strings will\nobviously be replaced. Hashes will only be updated, any pre-existing hash fields\nset on the DESTINATION will remain if they are not replaced by the SOURCE.\n\nAny pre-existing keys on DESTINATION that are not on SOURCE will remain untouched.\n\n## Usage\n\n```bash\nUsage: redis-migrator --source-host SOURCE-HOST [--source-port SOURCE-PORT]\n  [--source-db SOURCE-DB] [--source-user SOURCE-USER] [--source-pass SOURCE-PASS]\n  --destination-host DESTINATION-HOST [--destination-port DESTINATION-PORT]\n  [--destination-db DESTINATION-DB] [--destination-user DESTINATION-USER]\n  [--destination-pass DESTINATION-PASS] [--source-filter SOURCE-FILTER]\n  [--destination-prefix DESTINATION-PREFIX] [--verbose]\n\nOptions:\n  --source-host SOURCE-HOST\n                         source redis server hostname\n  --source-port SOURCE-PORT\n                         source redis server port [default: 6379]\n  --source-db SOURCE-DB\n                         source redis server db index [default: 0]\n  --source-user SOURCE-USER\n                         source redis server auth username\n  --source-pass SOURCE-PASS\n                         source redis server auth password\n  --destination-host DESTINATION-HOST\n                         destination redis server hostname\n  --destination-port DESTINATION-PORT\n                         destination redis server port [default: 6379]\n  --destination-db DESTINATION-DB\n                         destination redis server db index [default: 0]\n  --destination-user DESTINATION-USER\n                         destination redis server auth username\n  --destination-pass DESTINATION-PASS\n                         destination redis server auth password\n  --source-filter SOURCE-FILTER\n                         source keys filter string [default: *]\n  --destination-prefix DESTINATION-PREFIX\n                         destination key prefix to prepend\n  --verbose, -v          Print a lot more info\n  --help, -h             display this help and exit\n  --version              display version and exit\n```\n\n## Install\n\n#### Centos\n\nRPM hosted on [yum.jc21.com](https://yum.jc21.com)\n\n#### Go Get\n\n```bash\ngo get github.com/jc21/redis-migrator\n```\n\n\n#### Building\n\n```bash\ngit clone https://github.com/jc21/redis-migrator \u0026\u0026 cd redis-migrator\ngo build -ldflags=\"-X main.version=1.0.1\" -o bin/redis-migrator cmd/redis-migrator/main.go\n./bin/redis-migrator -h\n```\n\n\n## Real world example\n\nCopying data from one db to another on the same instance. This is a production instance\nwhere the keys were expiring mid-way through the migration, hence why the total\nnumber of keys migrated doesn't match the initial count.\n\n```bash\ntime redis-migrator --source-host 127.0.0.1 --source-db 0 --destination-host 127.0.0.1 --destination-db 1\nSOURCE:\n  Server:   127.0.0.1:6379\n  DB Index: 0\n  Auth:     None\nDESTINATION:\n  Server:   127.0.0.1:6379\n  DB Index: 1\n  Auth:     None\n2021-02-22 07:08:37 INFO =\u003e Source has 622028 keys\n2021-02-22 07:08:37 INFO =\u003e Destination has 0 keys\n2021-02-22 07:08:37 INFO =\u003e Found 622028 keys on SOURCE with Key filter: *\n2021-02-22 07:08:37 INFO =\u003e Migration running, each dot is ~1,000 keys\n.......... .......... .......... .......... .......... 8% (50012 / 622028)\n.......... .......... .......... .......... .......... 16% (100028 / 622028)\n.......... .......... .......... .......... .......... 24% (150037 / 622028)\n.......... .......... .......... .......... .......... 32% (200046 / 622028)\n.......... .......... .......... .......... .......... 40% (250058 / 622028)\n.......... .......... .......... .......... .......... 48% (300073 / 622028)\n.......... .......... .......... .......... .......... 56% (350084 / 622028)\n.......... .......... .......... .......... .......... 64% (400090 / 622028)\n.......... .......... .......... .......... .......... 72% (450102 / 622028)\n.......... .......... .......... .......... .......... 80% (500113 / 622028)\n.......... .......... .......... .......... .......... 88% (550127 / 622028)\n.......... .......... .......... .......... .......... 96% (600147 / 622028)\n.......... .......... ..\n2021-02-22 07:16:33 INFO =\u003e Migration completed with 622004 keys, 0 skipped :)\n\nreal    7m55.358s\nuser    0m52.892s\nsys     4m32.788s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjc21%2Fredis-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjc21%2Fredis-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjc21%2Fredis-migrator/lists"}