How it works
The Admin Server runs the FalkorDB fork ofredis-rdb-cli in Kubernetes Jobs:
- Export. For each shard, the Job reads a snapshot from a replica (or the primary) over the replication protocol and writes it to
<shard>.rdbin the backup repository. Each export gets its own folder,falkordb-rdb/<namespace>/<deployment>/<manual or schedule name>/<export name>/, which also holds amanifest.json. - Import. The Job replays every key of the source into the target’s primary. In a sharded target, keys are routed to the shard that owns them.
- Schedules. A scheduled export is a Kubernetes CronJob. After each successful run, it deletes all but the newest exports of that schedule.
Requirements
- A backup repository with the access method Mount. The default PVC repository qualifies. Repositories that use the Tool access method can’t be used.
- A ready primary in every shard of the target.
- For a deployment with TLS, the Admin Server must be able to read its CA certificate. This is always true for the Enterprise and cert-manager issuers.
A PVC repository keeps a separate volume in each namespace. An export written in one namespace is imported by a Job that runs in that namespace and connects to the target over the cluster network. If you use NetworkPolicies, allow traffic from pods labeled
app.kubernetes.io/component=rdb-transfer to the target’s FalkorDB port.Export a deployment
1
Open the deployment
In the Admin UI, open the deployment and select Data transfer.
2
Start the export
Click Export. Choose the repository and whether to read from a Replica (the default; falls back to the primary when a shard has no ready replica) or always from the Primary. Optionally, enter a key pattern.
3
Wait for it to finish
The export appears in the list as Pending, then Running, then Succeeded with its files, size, and key count. Click the logs icon to follow it.
--repository <name>, --node replica|primary, --db 0,1, --key-pattern <regex>, --cpu <limit>, --memory <limit>.
Exports of a sharded deployment are taken shard by shard. They aren’t a consistent point-in-time copy across shards. Pause writes first if you need one.
Schedule exports
In Data transfer, click Add schedule, or choose On a schedule in the export dialog. Set:
Runs never overlap: a run that is due while the previous one is still going is skipped. Use Run now to start one immediately, and the pause button to suspend the schedule.
Import into a deployment
1
Choose the source
Open the target deployment, select Data transfer, and click Import. Choose one of:
2
Choose what happens to existing data
- Merge keeps every key that already exists in the target and skips the imported value. A graph that already exists in the target can’t be merged: the import checks for this first and fails without writing anything.
- Replace deletes every key in the target, on every primary, before it imports. The target is only emptied once the source has been read successfully. Type the deployment’s name to confirm.
3
Choose a snapshot and rollback
- Snapshot before importing (checked by default) saves the target before changing it, so the import can be rolled back.
- Roll back automatically if the import fails (checked by default) restores that snapshot by itself when the import fails. Clear it to decide yourself.
4
Check the result
When the import succeeds, it shows how many keys were imported and how many were skipped because they already existed.
--from-uri password from FALKORDB_SOURCE_PASSWORD, or from standard input with --source-password-stdin, so it never appears in your shell history. --rollback auto|manual|none chooses what happens on failure, and --snapshot-repository <name> where the snapshot of a live copy is kept. For a live copy into an older target, --rdb-version <n> writes data in an older RDB format.
Every import reads its source once before writing anything: a merge to check for existing graphs, a replace to make sure the source can be read before the target is emptied. A live copy from another deployment or a Redis URI therefore makes the source take two snapshots.
Checks before an import
Before anything else, an import from an export or a repository file checks every file withredis-check-rdb, run from the target deployment’s own image. The import stops without changing the target when a file:
- fails its checksum, or has a value that can’t be read, for example because it is truncated;
- uses an RDB format version the target’s server can’t read, for example an export of a newer FalkorDB.
rdbVersion. Live sources are read directly and aren’t checked first.
Snapshots and rollback
Unless Snapshot before importing is unchecked, an import saves the target before changing it. The snapshot is taken from the primary of each shard, after every check passed, intofalkordb-rdb/<namespace>/<deployment>/pre-import/<import name>/ in a repository volume:
- for an import from a file, in the repository holding the file;
- for a live copy, in the default repository, or the one you choose.
Delete exports and imports
Deleting an export also deletes its files from the repository, unless you choose Keep the RDB files in the repository (--keep-files in the CLI). Deleting an import deletes its snapshot the same way. Deleting a running export or import stops it. A stopped import leaves the keys it has already written; roll it back first if it took a snapshot.
Deleting a schedule deletes the history of its exports and, unless you keep them, their files.
Retention
Finished exports and imports are deleted automatically after a number of days set in the Admin UI, under Settings > Retention:
0 turns either one off. The count starts when the transfer finishes, and the Admin Server checks every 10 minutes. It deletes transfers exactly as Delete does, and records each deletion in the audit log as
system. It never deletes a transfer that is still running, an import whose rollback is running or about to start, or an export from a schedule: a schedule keeps its newest exports by its own retention.
Once an import is deleted, its snapshot is gone and the import can no longer be rolled back. To keep that option longer, raise RDB Import Retention.
The Helm values adminServer.bootstrap.settingsConfig.settings.retention.rdb_import_retention_days and rdb_export_retention_days set the initial values when the chart creates the settings (adminServer.bootstrap.settingsConfig.create: true).
Permissions
RDB export and import use theclusters.transfers resource:
An import that reads from another namespace, whether an export, a repository volume, or a deployment there, also needs
create in that namespace. The predefined operator role has every action, and the viewer role has list and get.