From 4a86250d797fde18f9dfa9cbb39586b5b83ee91a Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Thu, 21 Apr 2016 22:38:02 -0700 Subject: [PATCH] Separate backup instructions into a separate doc --- BACKUPS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 BACKUPS.md diff --git a/BACKUPS.md b/BACKUPS.md new file mode 100644 index 00000000..0c1823d8 --- /dev/null +++ b/BACKUPS.md @@ -0,0 +1,11 @@ +# Backups + +rqlite supports hot-backing up a node. You can retrieve and write a consistent snapshot of the underlying SQLite database to a file like so: + +```bash +curl localhost:4001/db/backup -o bak.sqlite3 +``` + +The node can then be restored by loading this database file via `sqlite3` and executing `.dump`. You can then use the output of the dump to replay the entire database back into brand new node (or cluster), *with the exception* of `BEGIN TRANSACTION` and `COMMIT` commands. You should ignore those commands in the `.dump` output. + +By default a backup can only be retrieved from the leader, though this check can be disabled by adding `noleader` to the URL as a query param.