This topic is under construction for the 24.3 (March 2024) release of LabKey Server with embedded Tomcat 10. For the previous documentation, click here.
This topic provides example commands and scripts to help you perform backups of your server for several typical backup scenarios. These examples presume you are using PostgreSQL, which LabKey Server uses by default. They can be customized to your needs.
In each example,
- backupFile is the file in which the backup is stored.
- dbName is the name of the database for the LabKey Server. This is normally labkey
Perform a Full Backup of the PostgreSQL Database
The following command will perform a full backup of the database named dbname and store it in the file backupFile.
Linux:
pg_dump --compress=5 --format=c -f backupFile dbName
Windows: (substitute your local path to pg_dump.exe)
C:/Program Files/PostgreSQL/bin/pg_dump.exe --compress=5 --format=c -f backupFile dbName
Perform a Full Backup on a Linux Server, where the PostgreSQL Database is Being Run as the PostgreSQL User
su - postgres -c '/usr/bin/pg_dump --compress=5 --format=c -f /labkey/backups/labkey_database_backup.bak labkey'
Perform a Full Backup of your PostgreSQL Database and All Files Stored in Site-level File Root
TBD
Example Backup Script for Windows
TBD
Related Topics