Migration

Changing the site URL

When moving tirreno to a new domain or URL, update the SITE configuration:

Option 1: Configuration file

Edit config/local/config.local.ini:

[globals]
SITE = https://new-domain.com

Option 2: Environment variable

Set the SITE environment variable:

export SITE=https://new-domain.com

For Docker deployments, update the environment in docker-compose.yml:

environment:
  - SITE=https://new-domain.com

Multiple domains:

tirreno supports multiple domains (comma-separated):

SITE = https://primary.com,https://secondary.com

After changing the URL:

  1. Clear any cached sessions
  2. Update your application's tracker endpoint to point to the new URL
  3. Verify the Logbook receives events at the new location

Database migration

Exporting the database:

# Full database backup
pg_dump -U tirreno_app -d tirreno -F c -f tirreno_backup.dump

# Schema only
pg_dump -U tirreno_app -d tirreno --schema-only -f tirreno_schema.sql

# Data only
pg_dump -U tirreno_app -d tirreno --data-only -f tirreno_data.sql

Importing to new server:

# Create database on new server
createdb -U postgres tirreno

# Restore from backup
pg_restore -U tirreno_app -d tirreno tirreno_backup.dump

# Or restore from SQL
psql -U tirreno_app -d tirreno < tirreno_schema.sql
psql -U tirreno_app -d tirreno < tirreno_data.sql

Verify migration:

# Check table counts
psql -U tirreno_app -d tirreno -c "SELECT COUNT(*) FROM event_account;"
psql -U tirreno_app -d tirreno -c "SELECT COUNT(*) FROM event;"
________________________________________________________________________________