Warning

The product is in closed beta and not open to the public.

Back up a remote database with sqlite3_rsync

sqlite3_rsync copies a remote SQLite database to a local file over SSH. The examples below use Linux on both servers. Replace the server, account, and database paths with your own.

Prepare the tools

Download the command-line tools package for each server’s architecture from the SQLite download page. Install sqlite3_rsync on both the remote server and the local backup machine:

sudo install -o root -g root -m 0755 ./sqlite3_rsync /usr/local/bin/sqlite3_rsync

Use the same recent SQLite release on both servers (3.50.0 or later). The local machine needs an OpenSSH client and sufficient disk space. The remote SSH account must have access to the database and permission to run the tool.

Using an account with SSH access already configured, check both executables:

/usr/local/bin/sqlite3_rsync --version
ssh visionbyte@source.example.com /usr/local/bin/sqlite3_rsync --version

Copy the remote database

Run the following on the local backup machine:

install -d -m 0700 "$HOME/vb-backups"
umask 077
/usr/local/bin/sqlite3_rsync \
  visionbyte@source.example.com:/srv/visionbyte/repos/game-main.vbyte \
  "$HOME/vb-backups/game-main.vbyte" \
  --exe /usr/local/bin/sqlite3_rsync -v
  • The first argument identifies the SSH account, server, and absolute path of the remote database.

  • The second argument is the local destination file. It is created if absent; an existing destination is updated, so choose a path intended for backups.

  • --exe specifies the executable on the remote server.

  • -v displays transfer statistics, not continuous percentage progress.

Repeat the command with the same destination to synchronize later changes incrementally. Each invocation copies one database.

Check the exit status immediately after the command finishes and review its output for errors:

echo $?

A nonzero status indicates failure. See the SQLite remote-copy documentation for options and limitations.