Install
安裝 redis client
|
|
安裝 redis dump tool
|
|
OS:Mac
Package Manager:npm, Homebrew
Package Manager:npm, Homebrew
Export
使用 redis-dump 匯出資料至檔案:
|
|
redis-dump optino
- h - hostname
- p - port
- a - auth password
- d - database(db0)
- f - filter
Import
使用 redis-cli 匯入資料至 redis:
|
|
redis-cli optino
- h - hostname
- p - port
- a - auth password
- n - database(db0)
Other Recommend
另外,推薦幾個 redis 資料遷移的命令,但因為有權限和環境的限制較適合 DBA 使用。
- DUMP/RESTORE:輸出序列化的值/將值反序列化輸入。
- MIGRATE:將當前資料庫遷移至指定的資料庫。
- MOVE:將當前資料庫的 key 移動到指定的資料庫當中。