Home » NoSQL » Redis database migration

Redis database migration

said here refers to the database migration, is generated in a server database file, copy directly to another server, and two servers may use Redis port configuration and different
.
If you copy the database file dump.rdb directly to another Redis directory, you will find that the original data in the dump.rdb is missing, and only the newly added key-value.

In fact, the solution is simple, just change the Redis configuration file, you can.


################################ SNAPSHOTTING #################################
#
#, Save, the, DB, on, disk:
#
# save
#
#, Will, save, the, DB, both, the, if, given, number, of,, seconds, and, the, given
#, number, of, write, operations, against, the, DB, occurred.
#
#, In, the, example, below, the, behaviour, will,, be, to, save:
# after, 900 sec (15, min), if, at, least, 1, key, changed
# after, 300 sec (5, min), if, at, least, 10, keys, changed
# after 60, SEC, if, at, least, 10000, keys, changed
#
#, Note:, you, can, disable, saving, at, all, commenting, all, the, save, lines.
#
#, It, is, also, possible, to, remove, all, the,, previously, configured, save
#, points, by, adding, a, save, directive, with, a, single,, empty, string, argument
#, like, in, the, following, example:
#
"# save" ""
Save 900 1
Save 300 10
Save 60 10000

as long as the following line notes out, and then copy the generated database files in the past, you will find that the original data is still successful ~~~


save 9001
Save 30010
Save 60, 10000

Latest