Load into KiviDB: migrate from Redis to KiviDB
From replication: nothing to load; promote KiviDB in the runbook.
Self-hosted KiviDB
From replication: nothing to load; promote KiviDB in the runbook.
From an RDB file, either of these:
# Put it in the data directory. KiviDB reads dump.rdb at startup when there is no dump.kdb
cp dump.rdb /var/lib/kividb/dump.rdb
kividb --dir /var/lib/kividb
# Or name it. It is loaded instead of what is in --dir
kividb --dir /var/lib/kividb --preload-file rdb:/backups/dump.rdb
If the file can't be read, KiviDB refuses to start rather than start empty. The
log says what is wrong (not a Redis RDB file, a module type it does not read,
a damaged file). Once loaded, KiviDB writes its own dump.kdb and, with
--aof, its append-only file. Turn --aof on before you take traffic if you
need writes to survive a restart; KiviDB does not snapshot on a schedule.
From a copy tool: start KiviDB empty, then run RedisShake or RIOT as above with KiviDB as the target.
Configuration. Don't copy redis.conf across: KiviDB's config file is read
strictly, and a directive it does not know stops the server. Start from an
empty kividb.conf and carry over the settings you changed (maxmemory,
maxmemory-policy, requirepass or aclfile, appendonly, bind).
KiviDB Cloud
Create the database first, with Lua on if the application runs scripts,
and a data size at least as large as the source's used_memory. The overview
shows the endpoint, the port, the user kividbapp and its password; with TLS,
download the CA certificate from Configuration. See
Connect.
From an RDB file. Under Snapshots → Import a snapshot, upload the
dump.rdb (.rdb, .kdb and .aof files are accepted). Then create a
database from it, or restore it into an existing database. To seed a new
database straight from storage, give it an https:// URL that anyone holding
the link can read, such as a presigned S3 URL:
aws s3 presign s3://my-backups/dump.rdb --expires-in 3600
The file can't be larger than the database's data size.
From a copy tool. RedisShake and RIOT connect like any client. With TLS:
[redis_writer]
cluster = false
address = "your-name.cloud.kividb.io:6380"
username = "kividbapp"
password = "kividb-password"
tls = true
RedisShake encrypts the connection but checks the server certificate only when you also give it a client certificate, so run it from a network you trust. RIOT checks it against the CA certificate you download:
riot replicate redis://:$REDIS_PASSWORD@redis.internal:6379 \
rediss://your-name.cloud.kividb.io:6380 \
--target-user kividbapp --target-pass "$KIVIDB_PASSWORD" \
--target-cacert kividb-ca.pem --mode LIVE --compare NONE
The machine running the tool must be on the database's allow-list (Configuration → Network → Allowed IPs), or reach it through private connectivity.
Into a sharded database: set cluster = true under [redis_writer] and give
any shard's hostname (your-name-s1.cloud.kividb.io). A sharded database can't
be created from an imported file; it can be seeded only from a KiviDB snapshot
of the same shape. See Sharded databases.