Operations
Maintenance
Section titled “Maintenance”When a new version is available, run:
./update.shThe script performs the following steps:
- Pulls the latest Docker images
- Backs up the current volume data
- Creates a database backup
- Runs database migrations
- Starts all Docker services
- Cleans up unused Docker resources
Backup Strategy
Section titled “Backup Strategy”- Daily automated database backups via
pgbackupsservice - Volume data backup before updates
- Retention policies:
- 7 days of daily backups
- 4 weeks of weekly backups
- 6 months of monthly backups
The specifics can be adjusted in the docker-config file.
Backup Recovery
Section titled “Backup Recovery”First, make sure there are no connections to the database by terminating all active connections:
SELECT * FROM pg_stat_activity WHERE pg_stat_activity.datname='DataSpace';SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'DataSpace';Then drop and recreate the database:
DROP DATABASE "DataSpace";CREATE DATABASE "DataSpace";Finally, add the backup:
zcat "/opt/dataspaceswiss/DataSpace/volume/DataSpace_db_backup/<choose_your_backup>.sql.gz" | psql --host="database" --username="postgres" --dbname="DataSpace" -WManual Service Management
Section titled “Manual Service Management”# Start servicesdocker compose --file docker-compose.yml --env-file .env up -d
# Stop servicesdocker compose down
# View logsdocker compose logs -f
# Restart specific servicedocker compose restart api