Backups
What to copy, how to copy it while Nifty runs, and how to restore it.
On this page
Everything Nifty keeps is in one folder: /var/lib/nifty on a Linux server. Back up the database and files/, and
keep secret.key safe somewhere else.
What's in the folder
| Path | What | Back up? |
|---|---|---|
nifty.db (with -wal, -shm) |
The database: everything you've written | Yes, as below |
files/ |
Photos, note images and documents | Yes |
secret.key |
Unlocks the AI providers' API keys saved in the database | Separately |
acme/ |
Let's Encrypt certificates | Optional: Nifty gets new ones |
nifty.db.v<N>-<time>.bak |
A copy made before each update changed the database | Optional |
cache/ |
The compiled PDF renderer, made again if missing | No |
lock, tmp/ |
Working files | No |
Back up while Nifty runs
Don't copy nifty.db directly while Nifty runs: the copy can be half-written. Let SQLite make it (install sqlite3
first, e.g. sudo apt install sqlite3):
sudo sqlite3 /var/lib/nifty/nifty.db "VACUUM INTO '/backups/nifty-$(date +%F).db'"
sudo rsync -a /var/lib/nifty/files/ /backups/files/
Run them daily from cron or a systemd timer, and copy /backups off the machine.
Keep the secret key apart
secret.key (or NIFTY_SECRET_KEY, if you set it) unlocks the AI providers' API keys. Keep it out of your regular
backups, in a password manager, say. Without it, a restored Nifty works but asks for those API keys again in
Settings → AI.
Restore
Stop Nifty:
sudo systemctl stop nifty.Put the database back, and remove the old
-waland-shmfiles:sudo cp /backups/nifty-2026-10-10.db /var/lib/nifty/nifty.db sudo rm -f /var/lib/nifty/nifty.db-wal /var/lib/nifty/nifty.db-shmPut
files/back:sudo rsync -a /backups/files/ /var/lib/nifty/files/.Put
secret.keyback, if you have it.Give it all to the
niftyuser:sudo chown -R nifty:nifty /var/lib/nifty.Start Nifty:
sudo systemctl start nifty.
Restoring onto a newer version is fine: Nifty updates the database as it starts.
Copies before updates
Before an update changes the database, Nifty copies it to nifty.db.v<N>-<time>.bak in the same folder.
Rolling back uses them. Nifty keeps the five newest and deletes older ones.
On a Mac
The Mac app keeps everything in ~/Library/Application Support/Nifty, unless you chose another folder when you first
opened it. Quit Nifty and copy the folder, or run the same sqlite3 … "VACUUM INTO …" command while it runs.