Regularly backing up your environment, especially your database, is essential for ensuring the resilience and continuity of your deployment. Below are the recommended backup strategies and best practices.
1. Virtual Machine (VM) Backup
If you are deploying the product on your own VM, you can use your VM management tools to create full VM backups.
-
This approach captures the entire environment, including the application and the bundled PostgreSQL database, if used.
-
If your database server is also hosted on a VM, backing up that VM is equally recommended.
2. PostgreSQL Data Folder Copy During Software Upgrade
During a clean software upgrade, when both the application server and PostgreSQL database are shut down, it is good practice to make a physical copy of the entire postgresql\data directory:
-
Copy the folder to another drive or machine for safekeeping.
-
This ensures you have a full backup in a consistent state before significant changes.
3. PostgreSQL Database Dump
You can also create logical backups using PostgreSQL's dump utilities (as documented in related sections):
-
In some cases, a database dump can be performed while the database is running.
-
However, it is strongly recommended to perform dumps when the database is quiet---meaning no users are connected and no imports, builds, or maintenance tasks are active---to ensure consistency.
Additional Best Practices
Regular Repository Cleanup
To reduce database size and improve performance, regularly clean up your repository by removing obsolete or excessive model versions. See Repository Cleanup for detailed instructions.
Daily Database Maintenance
It is recommended to run database maintenance scripts daily to optimize performance. See Run Database Maintenance for more information.
Exceptional PostgreSQL Space Reclamation
The bundled PostgreSQL server uses automatic vacuuming:
-
As old model versions are deleted, space is automatically reused by new versions.
-
Manual compaction (shrinking) is rarely needed and should only be performed if a significant amount of data is deleted at once.
-
Manual shrinking requires advanced DBA expertise and is not recommended for routine operations.
Exceptional PostgreSQL compacting
The bundled PostgreSQL server runs in auto-vacuum mode, so nothing else is needed as model versions are deleted, the next model versions will reuse that space. If a massive deletion of configurations and models is performed, you may need to shrink the PostgreSQL database manually, but this requires DBA expertise and is not recommended.