Database
Porto uses the same schema on two databases, with migrations numbered the same way.
SQLite (default)
Section titled “SQLite (default)”Without DATABASE_URL Porto uses the porto.db file in the data folder (PORTO_DATA_DIR). Nothing to install: the
driver is in the binary. It suits most marinas and is the only database of the desktop app.
PostgreSQL (optional)
Section titled “PostgreSQL (optional)”Recommended above 300 berths, with several marinas in the same installation, or when your infrastructure already
runs PostgreSQL. Set DATABASE_URL:
DATABASE_URL=postgres://porto:PASSWORD@db.internal:5432/porto?sslmode=requireSpecial characters of the password must be URL-encoded (@ becomes %40). With Docker use
deploy/docker-compose.postgres.yml (PostgreSQL 17), see Docker.
Migrations
Section titled “Migrations”- With
PORTO_AUTO_MIGRATE=true(default)porto serveapplies migrations on start. - With
PORTO_AUTO_MIGRATE=falsethe server does not start while migrations are pending: apply them withporto migrate up.porto migrate status --checkexits with 1 when some are pending (useful in scripts). - Migrations only move forward: an older Porto version cannot run on the same database. To go back, restore the backup taken before the update.
From SQLite to PostgreSQL (and back)
Section titled “From SQLite to PostgreSQL (and back)”The backup format does not depend on the database:
- on the old installation:
porto backup --out porto.porto-backup; - start the new installation with the same Porto version, the same
PORTO_SECRET_KEYand the newDATABASE_URL; porto restore --in porto.porto-backup(on an empty database) or with--forceto wipe it first.
See Backup and restore.
Porto is developed by Coste360 SRL. Source available under the BSL 1.1; the Porto trademark is not covered by the licence.