Backup and restore#
Back up every part of an instance that Git cannot rebuild, and test recovery before you need it. A backup that has never been restored is an assumption, not a recovery plan.
The procedures below run from the instance directory containing vole.toml and
data/. Start Vole at least once before backing it up so it creates its SSH host
key. Use an account that can read all instance files. Commands for a packaged
Linux service use sudo; for a local instance, stop vole serve with Ctrl+C
and run the Vole commands as the instance owner.
What to back up#
| Back up | Rebuild instead |
|---|---|
data/instance.db — accounts, access rules, CI history, release channels, and sealed secrets |
data/index.db — rebuild with vole admin index rebuild |
data/repos/ — source and collaboration history |
|
data/lfs/ — large files and build artifacts |
|
data/logs/ — CI attempt logs |
|
data/ssh_host_ed25519_key — Vole's SSH host key |
|
data/audit.log — privileged-action history |
|
data/acme/ — automatic HTTPS account and certificates |
Vole can request new certificates, but backing them up avoids that work |
data/secrets.key — store separately from the rest of the backup |
Instance data explains the storage model.
Back up an instance#
The procedure creates an application backup in backup/ and stores the
secrets-encryption key separately in key-backup/.
1. Stop writes#
For a point-in-time copy of every file, stop the packaged service:
sudo systemctl stop vole
Stopping the service interrupts web and Git access. If you cannot stop it, the database command below is safe while Vole runs, but clone every repository instead of copying live repository directories and expect the other files to be only an approximate point in time.
2. Create private backup directories#
install -d -m 0700 backup key-backup
3. Copy the authoritative database#
vole admin db backup backup
This writes backup/instance.db with SQLite VACUUM INTO, preserving recent
transactions in the write-ahead log. A plain copy of a live database can miss
those transactions. The command skips the derived index.db and does not copy
secrets.key.
Use vole admin db list to see the databases and their backup classification.
4. Copy repositories and stored files#
cp -a data/repos backup/
cp -a data/lfs backup/
cp -a data/logs backup/
cp -a data/acme backup/ 2>/dev/null || true
cp data/ssh_host_ed25519_key backup/
cp data/audit.log backup/
An instance using the sshd front door presents the system SSH host key instead. Copy that private key too:
sudo install -m 0600 /etc/ssh/ssh_host_ed25519_key backup/ssh_host_ed25519_key.sshd
A restore that omits the active host key changes the identity that Git clients and CI runners verify.
5. Store the secrets key separately#
install -m 0600 data/secrets.key key-backup/secrets.key
If secrets_key names another path, copy that file instead.
Keep the key out of the database backup
A copy containing both instance.db and secrets.key is effectively a copy
of the repository secrets in plaintext. Store the key separately. Losing it
makes the sealed secret rows unreadable.
6. Restart and move the backups off the machine#
sudo systemctl start vole
Move both backup sets to protected off-machine storage and record which one holds the encryption key. The database contains account metadata, access rules, CI history, and sealed secret ciphertext, so treat it as private even without the key.
Restore an instance#
Restore a complete backup set into an empty data directory. Do not merge it with files from a different point in time or leave a running server writing to it.
1. Stop Vole and preserve the current directory#
On a packaged installation:
sudo systemctl stop vole
mv data data.before-restore
install -d -m 0750 data
Keep data.before-restore until the restored instance passes verification. For
a local instance, stop vole serve first and run the same commands as its owner.
2. Restore one backup set#
From the instance directory, copy the files back:
cp backup/instance.db data/
cp -a backup/repos data/
cp -a backup/lfs data/
cp -a backup/logs data/
cp -a backup/acme data/ 2>/dev/null || true
cp backup/ssh_host_ed25519_key data/
cp backup/audit.log data/
install -m 0600 key-backup/secrets.key data/secrets.key
If secrets_key names another path, restore the key there instead. For an sshd
front-door instance, also restore
backup/ssh_host_ed25519_key.sshd to /etc/ssh/ssh_host_ed25519_key with mode
0600, then restart or reload sshd according to your distribution.
On a packaged installation, return ownership to the service account:
chown -R vole:vole data
chmod 0600 data/secrets.key data/ssh_host_ed25519_key
3. Rebuild derived indexes and revoke restored sessions#
From a local instance directory, run:
vole admin index rebuild
vole admin account revoke-sessions --all
For the packaged installation, run them as the service account:
sudo -u vole vole admin --config /etc/vole/vole.toml index rebuild
sudo -u vole vole admin --config /etc/vole/vole.toml account revoke-sessions --all
Revoking sessions prevents browser cookies from the old system from outliving the restored revocation state. Rebuilding the index does not restore any unique data; it reconstructs derived repository, activity, and search records from Git.
4. Start Vole and verify recovery#
sudo systemctl start vole
Check all of the following before returning the instance to service:
- account sign-in and an SSH clone;
- source, issue, and change-request pages;
- CI history and a stored artifact;
- a release download and any hosted sites;
- runner connectivity and the expected SSH host key.
Once those checks pass, remove data.before-restore according to your retention
policy. If instance.db is unrecoverable, repositories remain usable, but you
must recreate accounts, credentials, access rules, release channels, and CI
history. Finished runs and in-flight queue state cannot be reconstructed from
Git.
Next#
- Upgrade an installed server — install a release after a tested backup.
- Instance data — authoritative and derived storage.
- LFS and file locking — reclaim stored objects.