# Move Easy CMS from SQLite to Postgres with easy-cms copy

> Start on a SQLite file and move to Postgres later: one CLI command copies documents, versions and users, keeping every id.

URL: https://easycms.dev/blog/moving-from-sqlite-to-postgres  
Published: 2026-09-21  
Updated: 2026-10-29

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.

```bash
npx easy-cms copy --from easy-cms.old.config.ts
```

The 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.
