Server Maintenance
Database backup, upgrade, and restore for Speckle server
We recommend backing up your database regularly, and especially prior to upgrading Speckle. Backing up a database is often a requirement of a database upgrade, migrating your database between servers, or recovering from an incident.
Speckle’s preferred method of backing up and restoring data in a Postgres database is with pgAdmin. This guide assumes you are running Speckle via Docker-Compose.
Prerequisites
- Docker should be installed and running
- Manual installation instructions should have been completed
Setup pgAdmin
Check and start pgAdmin
Check if pgAdmin is already running:
If not running, create docker-compose-pgadmin.yml
with the following configuration:
Then start pgAdmin:
Access pgAdmin
Find the pgAdmin port and access the dashboard:
Open http://127.0.0.1:16543/
in your browser (replace 16543 with your actual port).
Backup
Backup database
Connect to pgAdmin, then connect to your Postgres server. Right-click on the speckle
database, select Backup...
, choose a location, and click Backup
to start the process.
Upgrade
Deploy new version
Clone the Speckle Server repository and deploy the updated version:
Verify deployment
Check that all containers are running:
Stop and clean up old database
⚠️ CAUTION This will cause Speckle to stop working until restored. Notify users before proceeding.
Stop and remove the old Postgres container:
Find and delete the database volume:
Restore
Transfer and restore backup
If needed, transfer your backup file to the host machine, then copy it to the pgAdmin container:
Connect to pgAdmin, create a new speckle
database, then right-click it and select restore
to load your backup.
Verify restoration
Deploy Speckle server if not already running and verify the data is correct.
Your database has been successfully backed up, upgraded, and restored. Regular backups are recommended as part of your maintenance routine, regardless of whether you’re performing upgrades.