{"id":19695847,"url":"https://github.com/codislabs/redis-port","last_synced_at":"2025-04-05T00:10:31.196Z","repository":{"id":27567627,"uuid":"31049903","full_name":"CodisLabs/redis-port","owner":"CodisLabs","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-27T03:17:49.000Z","size":1021,"stargazers_count":630,"open_issues_count":19,"forks_count":165,"subscribers_count":48,"default_branch":"redis-4.x-cgo","last_synced_at":"2025-03-28T23:09:34.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodisLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-20T03:45:01.000Z","updated_at":"2025-03-18T07:13:57.000Z","dependencies_parsed_at":"2022-08-08T08:15:35.996Z","dependency_job_id":null,"html_url":"https://github.com/CodisLabs/redis-port","commit_stats":null,"previous_names":["wandoulabs/redis-port"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodisLabs%2Fredis-port","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodisLabs%2Fredis-port/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodisLabs%2Fredis-port/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodisLabs%2Fredis-port/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodisLabs","download_url":"https://codeload.github.com/CodisLabs/redis-port/tar.gz/refs/heads/redis-4.x-cgo","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266565,"owners_count":20910836,"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":[],"created_at":"2024-11-11T19:31:09.011Z","updated_at":"2025-04-05T00:10:31.180Z","avatar_url":"https://github.com/CodisLabs.png","language":"Go","readme":"redis-port\n===========\n\n[![Build Status](https://travis-ci.org/CodisLabs/redis-port.svg)](https://travis-ci.org/CodisLabs/redis-port)\n\nparse redis rdb file, sync data between redis master and slave\n\n* **DECODE** dumped payload to human readable format (hex-encoding)\n\n```sh\nredis-port decode    [--ncpu=N] [--parallel=M] \\\n    [--input=INPUT] \\\n    [--output=OUTPUT]\n```\n\n* **RESTORE** rdb file to target redis\n\n```sh\nredis-port restore   [--ncpu=N] [--parallel=M] \\\n    [--input=INPUT]  [--faketime=FAKETIME] [--extra] [--filterdb=DB] \\\n     --target=TARGET [--auth=AUTH] [--redis|--codis]\n```\n\n* **DUMP** rdb file from master redis\n\n```sh\nredis-port dump      [--ncpu=N] [--parallel=M] \\\n     --from=MASTER   [--password=PASSWORD] [--extra] \\\n    [--output=OUTPUT]\n```\n\n* **SYNC** data from master to slave\n\n```sh\nredis-port sync      [--ncpu=N] [--parallel=M] \\\n     --from=MASTER   [--password=PASSWORD] [--psync] [--filterdb=DB] \\\n     --target=TARGET [--auth=AUTH] [--redis|--codis] [--sockfile=FILE [--filesize=SIZE]]\n```\n\nOptions\n-------\n+ -n _N_, --ncpu=_N_\n\n\u003e set runtime.GOMAXPROCS to _N_\n\n+ -p _M_, --parallel=_M_\n\n\u003e set number of parallel routines\n\n+ -i _INPUT_, --input=_INPUT_\n\n\u003e use _INPUT_ as input file, or if it is not given, redis-port reads from stdin (means '/dev/stdin')\n\n+ -o _OUTPUT_, --output=_OUTPUT_\n\n\u003e use _OUTPUT_ as output file, or if it is not given, redis-port writes to stdout (means '/dev/stdout')\n\n+ -m _MASTER_, --master=_MASTER_\n\n\u003e specify the master redis\n\n+ -t _TARGET_, --target=_TARGET_\n\n\u003e specify the slave redis (or target redis)\n\n+ -P PASSWORD, --password=PASSWORD\n\n\u003e specify the redis auth password\n\n+ -A AUTH, --auth=AUTH\n\n\u003e specify the auth password for target\n\n+ -e, --extra\n\n\u003e dump or restore following redis backlog commands\n\n+ --redis\n\n\u003e target is normal redis instance, default value is **false**.\n\n+ --codis\n\n\u003e target is codis proxy, default value is **true**.\n\n+ --filterdb=DB\n\n\u003e filter specifed db number, default value is '*'\n\nExamples\n-------\n\n* **DECODE**\n\n```sh\n$ cat dump.rdb | ./redis-port decode 2\u003e/dev/null\n {\"db\":0,\"type\":\"string\",\"key\":\"a\",\"value\":\"hello\"}\n {\"db\":1,\"type\":\"string\",\"key\":\"a\",\"value\":\"9\"}\n {\"db\":0,\"type\":\"hash\",\"key\":\"c\",\"field\":\"hello\",\"value\":\"world\"}\n {\"db\":0,\"type\":\"expire\",\"key\":\"c\",\"expireat\":1487663341422}\n {\"db\":0,\"type\":\"list\",\"key\":\"b\",\"index\":0,\"value\":\"hello\"}\n {\"db\":0,\"type\":\"list\",\"key\":\"b\",\"index\":1,\"value\":\"world\"}\n {\"db\":0,\"type\":\"zset\",\"key\":\"d\",\"member\":\"hello\",\"score\":1}\n {\"db\":0,\"type\":\"zset\",\"key\":\"d\",\"member\":\"world\",\"score\":1.8}\n  ... ...\n```\n\n* **RESTORE**\n\n```sh\n$ ./redis-port restore -i dump.rdb -t 127.0.0.1:6379 -n 8\n  2014/10/28 15:08:26 [ncpu=8] restore from 'dump.rdb' to '127.0.0.1:6379'\n  2014/10/28 15:08:27 total = 280149161 -     14267777 [  5%]\n  2014/10/28 15:08:28 total = 280149161 -     27325530 [  9%]\n  2014/10/28 15:08:29 total = 280149161 -     40670677 [ 14%]\n  ... ...                                                    \n  2014/10/28 15:08:47 total = 280149161 -    278070563 [ 99%]\n  2014/10/28 15:08:47 total = 280149161 -    280149161 [100%]\n  2014/10/28 15:08:47 done\n```\n\n* **DUMP**\n\n```sh\n$ ./redis-port dump -f 127.0.0.1:6379 -o save.rdb\n  2014/10/28 15:12:05 [ncpu=1] dump from '127.0.0.1:6379' to 'save.rdb'\n  2014/10/28 15:12:06 -\n  2014/10/28 15:12:07 -\n  ... ...\n  2014/10/28 15:12:10 total = 278110192 -            0 [  0%]\n  2014/10/28 15:12:11 total = 278110192 -    278110192 [100%]\n  2014/10/28 15:12:11 done\n\n$ ./redis-port dump -f 127.0.0.1:6379 | tee save.rdb | ./redis-port decode -o save.log -n 8 2\u003e/dev/null\n  2014/10/28 15:12:55 [ncpu=1] dump from '127.0.0.1:6379' to '/dev/stdout'\n  2014/10/28 15:12:56 -\n  ... ...\n  2014/10/28 15:13:10 total = 278110192  -   264373070 [  0%]\n  2014/10/28 15:13:11 total = 278110192  -   278110192 [100%]\n  2014/10/28 15:13:11 done\n```\n\n* **SYNC**\n\n```sh\n$ ./redis-port sync -f 127.0.0.1:6379 -t 127.0.0.1:6380 -n 8\n  2014/10/28 15:15:41 [ncpu=8] sync from '127.0.0.1:6379' to '127.0.0.1:6380'\n  2014/10/28 15:15:42 -\n  2014/10/28 15:15:43 -\n  2014/10/28 15:15:44 -\n  2014/10/28 15:15:46 total = 278110192 -      9380927 [  3%]\n  2014/10/28 15:15:47 total = 278110192 -     18605075 [  6%]\n  ... ...                                              [    ]\n  2014/10/28 15:16:14 total = 278110192 -    269990892 [ 97%]\n  2014/10/28 15:16:15 total = 278110192 -    278110192 [100%]\n  2014/10/28 15:16:15 done\n  2014/10/28 15:16:17 pipe: send = 0             recv = 0\n  2014/10/28 15:16:18 pipe: send = 0             recv = 0\n  ... ...\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodislabs%2Fredis-port","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodislabs%2Fredis-port","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodislabs%2Fredis-port/lists"}