The following checklist provides a general guideline for backing up your data. For an example backup plan see A Sample Backup Plan
You should backup the following data in LabKey Server:
If you are using our recommended folder configuration
, the <LABKEY_ROOT>\backup
subdirectory is a good place to store backups locally. The commands below will place the backup into this structure, so either create the necessary folder or alter the command you run.
Backup procedures will vary somewhat based on the type and location of your database. These guidelines can get you started.
The default LabKey installation uses a PostgreSQL database. Locate your PostgreSQL installation. If you are already using the recommended folder structure
, your database will be under the <LABKEY_ROOT>\apps
The database username and password are stored in the LabKey configuration file, labkey.xml
, typically located in the <CATALINA_HOME>/conf/Catalina/localhost
directory. Note: <CATALINA_HOME> is where Tomcat is installed.
- Open a command window, choosing "Run as Administrator".
- Navigate to the \bin directory in your Postgres installation.
- Run the following command, using the username and password obtained from the labkey.xml file:
pg_dumpall.exe -g -U <USERNAME>
- Enter the password when prompted and copy the output to an empty notepad file. You will need the specific information listed in the Roles area of the output. Do not close this command window yet.
- Open the Control Panel > Administrative Tools > Services and stop the LabKey Tomcat service.
- From the command window, run the following command to make a database dump:
pg_dump.exe -f C:labkeybackuplabkey_migration_backup.bak --clean --format=c --no-acl --no-owner --dbname='labkey'
- After the backup has been completed, stop the PostgreSQL services.
You can find more backup guidance in the PostgreSQL documentation available here:
Microsoft SQL Server
For further information on administering Microsoft SQL Server, see the documentation that came with your Microsoft SQL Server installation.
Data Files Site-level File Root.
You should backup the contents (files and sub-directories) of the site-level file root. The location of the site-level file root is set at: (Admin) > Site > Admin Console > Admin Console Links > Files
- Navigate to the file root location (for instance, an older installation might have been located in: C:\Program Files (x86)\LabKey Software).
- Right-click on the files folder and select Send To > Compressed (zipped) folder to create a zip file of the folder.
- Move this zip file to C:\labkey\backup.
You should also back up any directories or file shares that you specify as root directories for the LabKey pipeline. In addition to the raw data that you place in the pipeline directory, LabKey will generate files that are stored in this directory. The location of the pipeline root is available at: (Admin) > Go To Module > Pipeline > Setup
.Other File Locations.
To see a summary list of file locations: go to (Admin) > Site > Admin Console > Admin Console Links > Files
, and then click Expand All
. Note the Default
column: if a file location has the value false
, then you should backup the contents of that location manually.
Note: For some LabKey Server modules, the files (pipeline root or file content module) and the data in the database are very closely linked. Thus, it is important to time the database backup and the file system backup as closely as possible.
Configuration and Log FilesLog Files.
Log files are located in <CATALINA_HOME>/logs
Configuration files, including labkey.xml, are located in <LABKEY_HOME>