Backup, upgrade, move, uninstall

Two things make up a NeverLapse server: its database and its data protection certificate. Back up both.

Back up

  1. The data protection certificate, once: Settings > Data Protection Certificate > Download a backup, with a password of at least 12 characters. Keep the file and password away from this server (a password manager is ideal). Without it, a restored database's stored secrets (DNS tokens, logins) can't be decrypted.
  2. The database, regularly, with your usual SQL Server backups. With the SQL Server Express that Setup installed (instance NEVERLAPSE, database NeverLapse), for example from an elevated prompt on the server:
    sqlcmd -S .\NEVERLAPSE -E -Q "BACKUP DATABASE NeverLapse TO DISK='C:\Backup\NeverLapse.bak' WITH INIT"
    Schedule it with Task Scheduler (Express has no SQL Agent) and copy the file somewhere safe. SQL Server Management Studio's Back Up works too. On Linux and Docker the database is PostgreSQL: back it up with your usual PostgreSQL backups (Docker: the volumes neverlapse-data and neverlapse-db).

Issued certificates themselves don't need a backup: NeverLapse can always issue new ones.

Upgrade to a new version

On NeverLapse Cert 1.9.0 or newer the easiest way is Settings > Updates > Install: it downloads, checks, backs up and rolls back by itself if needed. See Updates. To upgrade by hand (and once for anything older than 1.9.0):

  1. Download the new installer from your account.
  2. Run it as administrator on the NeverLapse server. It recognises the existing install and keeps the database, address, port, certificate, service account and settings; it only installs prerequisites that are missing.
  3. Agents keep working. Update them from the Hosts page (select them, then Update selected agents), or turn on automatic agent updates under Settings > Pull Agents. Agents from 1.2.9 or older, and the Linux script agent, need their install command run once; see Agent updates. After an agent upgrade the agent re-applies its certificates once on the next check-in.

Linux: run sudo ./install.sh from the new package. Docker: build the new image (tag = the new package's VERSION), set NEVERLAPSE_VERSION in .env to it, then docker compose up -d. See Install on Linux or Docker.

Move NeverLapse to a new server

  1. On the old server, back up the database and the data protection certificate (above).
  2. Restore the database onto the SQL Server the new NeverLapse should use (or keep using the same SQL Server).
  3. Install NeverLapse on the new server and choose Use an existing SQL Server pointing at that database. On Linux: restore the PostgreSQL database and run install.sh --db pointing at it.
  4. On the new server: Settings > Data Protection Certificate > Restore from a backup.
  5. Move the license: Remove from this server on the old one (or Release it in your account), then activate on the new one. See Moving a license.
  6. Point the console's DNS name at the new server. Agents use that name, so they follow by themselves. If the name changes, run each agent's install command again.
  7. Windows push hosts and Windows DNS (NeverLapse on Windows only): make sure the new server can reach them, and if you used a domain service account, use it again.

Uninstall

  1. Free the license first: Settings > License > Remove from this server.
  2. Windows Settings > Apps (or Programs and Features) > NeverLapse Cert > Uninstall.
  3. Setup asks Also remove all NeverLapse data from this server?
    • Yes permanently deletes the SQL Server Express instance Setup created (with the NeverLapse database) and C:\ProgramData\NeverLapse (certificate files, keys, logs). A database on your own SQL Server is never removed.
    • No keeps everything, so reinstalling later picks up where you left off.

Silent uninstall (add /REMOVEDATA=1 to also remove the data):

"C:\Program Files\NeverLapse\unins000.exe" /VERYSILENT /REMOVEDATA=1

Linux: sudo /opt/neverlapse-cert-server/uninstall.sh (keeps data, settings and database; add --purge to remove them).

Agents on other servers aren't removed by this: uninstall them there (NeverLapseAgent.exe /UNINSTALL on Windows, sudo neverlapse-agent uninstall on Linux). Certificates already installed on your servers stay until they expire.