Overview
Any non-trivial pulse™ setup will include two types of valuable data:
- The server configuration/settings.
- Project and personal build history, including built artifacts.
This data should be regularly backed up to guard against server or hardware failure. This page describes where the valuable data is stored, how to take a reliable snapshot, and how to restore that snapshot.
Note that pulse™ does take backups of your configuration for you automatically, see Backup Configuration for details. However, this is not a replacement for a full backup strategy.
Data Location
All valuable data is stored on the pulse™ master. Agents are not used for persistent data storage, and as such data loss on an agent is not usually an issue. The master stores data in two locations:
- The data directory. This directory stores all of your server configuration, plus build logs and artifacts. For a full description of the data directory contents refer to the cookbook.
- The database. This stores all state information, such as build results.
Note that the embedded database would itself be stored in the data directory, but all production deployments of pulse™ should use an external database. External databases are more robust and come with more management tools.
Creating Backups
The simplest method for doing a full backup of your data is to:
- Shut down the master server.
- Take a copy of the entire data directory.
- Take a dump of the entire database using your database vendor's tools (e.g. mysqldump).
- Restart the master.
It is important to shut down the master first as pulse™ is continually scheduling tasks (including builds), making it difficult to guarantee a consistent data snapshot while the server is running.
Saving Space
To reduce the size of your backups, you can consider excluding some of the less critical parts of the data directory. Subdirectories that may be excluded are:
| Directory |
Contents |
| archives |
Automatic configuration backups taken by the master. Not strictly required, but also not particularly large so potentially not worth excluding. |
| backups |
Automatic backups of the embedded database. Should be empty on servers using external databases. |
| recipes |
Temporary build working area. |
| work |
Persistent build working area, for incremental or clean update builds. If this is missing on restore your projects will simply run a clean build. |
You may also exclude some of the build artifacts stored in the projects and/or users subdirectories, but note that these form part of your build history. Pulse will run without them, but your builds will not have full logs, test results or artifacts.
Restoring Backups
To restore a copy of your data directory and database, you simply need to point pulse™ to the right directory and database location. The location of the data directory is stored in the server configuration file, which is $HOME/.pulse2/config.properties by default. To set a different data directory location, edit the pulse.data property. If no configuration file is present when you start pulse™ you will be prompted for the data directory location.
To restore your database, load the database dump using your database vendor's tools.
 | New Database Name
If you load your database dump into a different database name, you will need to update your configuration to point to this new database. To do so, edit the file $PULSE_DATA/config/database.properties and update the jdbc.url property to point to your new database. |