Leadlantern docs
v1.0.0
Get help
● Run · Data

Backups and updates
keep your data, replace the code.

Everything Leadlantern knows is in one folder, data, plus your .env file. Back up those two and you can rebuild the installation anywhere. An update replaces only the code; the database upgrades itself on the next start.

data/ + .envsqlite3 .backupNo migration step

01What to back up

FileHolds
data/leadlantern.sqliteLeads, searches, website checks, report links, messages, notes, tasks, history, the do-not-contact list.
data/admin.sqliteSettings, encrypted keys, team, sessions, audit log, settings history.
data/.admin-secret-keyOnly when you did not set ADMIN_SECRET_KEY yourself.
.envYour ADMIN_SECRET_KEY and other variables. Without the key the saved keys in admin.sqlite cannot be read.

Keep backups somewhere other than the server, and keep them private: they contain your leads and your team's sign-in data.

02Make a backup

Windows

The commands on this page are written for macOS and Linux shells. On a Windows PC run them inside WSL (Ubuntu) or in Git Bash; production belongs on a Linux server. See Windows.

Either stop the server and copy the folder:

sudo systemctl stop leadlantern
sudo tar czf /path/to/backups/leadlantern-$(date +%F).tgz -C /path/to/leadlantern/source data .env
sudo systemctl start leadlantern

or, without stopping, let SQLite write a consistent copy of each database (install the sqlite3 tool first: sudo apt-get install -y sqlite3):

cd /path/to/leadlantern/source
sqlite3 data/leadlantern.sqlite ".backup '/path/to/backups/leadlantern.sqlite'"
sqlite3 data/admin.sqlite ".backup '/path/to/backups/admin.sqlite'"

A settings-only copy as JSON: Export / Import.

03Restore

  1. Stop the server.
  2. Put the backed-up files into data/ and the .env next to package.json, owned by the leadlantern user.
  3. Start the server.

04Update to a new version

  1. Read the changelog of the new version (Changelog).
  2. Back up data/ and .env (above).
  3. Stop the server: sudo systemctl stop leadlantern.
  4. Replace the code with the new source folder, keeping data/ and .env.
  5. Install, compile and start:
cd /path/to/leadlantern/source
sudo -u leadlantern pnpm install
sudo -u leadlantern pnpm build
sudo systemctl start leadlantern

The database is upgraded by itself on start; there is no separate migration step. Forgetting pnpm build leaves the old compiled code in dist/ running. Afterwards open Status and check that every line is as before.