Lite to Standard Upgrade

Migrate an existing Lite Mode (SQLite) deployment to Standard Mode (CouchDB 3.4) without losing data or re-pairing devices.

Overview

When your VPS is upgraded to 2+ GB RAM and 2+ vCPU—or you want CouchDB 3.4 and optional Caddy HTTPS—you can migrate from Lite Mode to Standard Mode using:

sudo bash /opt/synora/installer/upgrade-to-standard.sh

What the Upgrade Script Does

  1. Creates a full backup: Stops Lite Mode cleanly and copies deployment/lite/data/api and deployment/lite/.env to deployment/backups/lite-to-standard-<timestamp>/.
  2. Prepares Standard Mode configuration: Writes deployment/standard/.env preserving your existing SYNORA_API_KEY, COMPOSE_PROFILES, CLOUDFLARE_TUNNEL_TOKEN, and SYNORA_DOMAIN, while generating CouchDB credentials.
  3. Starts CouchDB & waits for healthcheck: Builds the Standard API image and waits for couchdb:3.4 to report healthy.
  4. Migrates & verifies records: Runs node src/migrate.js to transfer vaults, devices (including token hashes), pairing records, file metadata, blobs, and audit logs, verifying record integrity.
  5. Starts Standard Mode: Brings up all configured Standard services.

All existing device tokens (syn_dev_...) remain valid; connected Obsidian devices do not need to re-pair.

Rollback Safety

Your original Lite data and backup are never deleted during upgrade. If migration fails—or you ever need to revert—the script prints exact rollback commands to stop Standard Mode, restore the backup into deployment/lite/, and run docker compose up -d in Lite Mode.