Moving from SQLite to Postgres
Start on a SQLite file, grow into Postgres. One CLI command copies every document, version and user between the two.
SQLite is a fine choice for one server with a disk. Move to Postgres when you deploy to serverless, run several servers, or your host offers managed Postgres with backups.
Before launch
If the content so far is test content, switch the adapter to postgres(), replace the migrations with npx easy-cms migrate:create init, and start fresh. Migrations are written in one database's SQL, so the SQLite ones don't carry over.
With content to keep
easy-cms copy moves documents, versions, users (logins keep working), globals and scheduled jobs. Ids stay the same, so relationships still point to the right documents.
Back up first with
npx easy-cms backup.Keep a second config for the old SQLite database next to the main one.
Point the main config at Postgres, create its migrations and run them.
Copy while nobody is editing, then check the admin, a few documents and a login.
npx easy-cms copy --from easy-cms.old.config.tsThe target must be empty, so running it twice by accident changes nothing. Uploads stay where they are, in uploads/ or your bucket. The same command works from Postgres back to SQLite.
The recipe Move from SQLite to Postgres in the docs has every step.