CloudBees Flow Server Backups

You should back up your existing CloudBees Flow data frequently. We recommend full regular (nightly) database backups and database backups before an upgrade.

Data Backup Methods

There are two ways to back up your data. You can use a database-specific backup tool to create a database dump, or you can use the CloudBees Flow ( ectool export ) tool to create a complete XML database backup. This section describes the differences between the two types of backups.

We recommend that you do not use the ectool export tool with jobs on an active system to create a trusted database backup.

Database Dumps

You must use a database-specific backup tool to create a database dump. Database dumps have the following characteristics:

  • The backup process takes much less time to complete than full XML exports

  • Database dumps (for example MySQL) must be performed while the database is live, up, and running.

  • You can quickly restore a database from a database dump.

A database dump can only be restored to the same type of database. If you are planning to switch your database type when you restore from the backup, you must create an XML backup.

Complete XML Database Backup

You must use the ectool export tool to create a complete XML database backup. Complete XML database backups have the following characteristics:

  • The tool must be used while the CloudBees Flow server is running.

  • The database backup process can take considerably longer than simply creating a database dump, but this method is necessary in the following situations:

  • Backing up the database is not an available option.

  • You need to migrate from one type of database to another. For example, MySQL to Oracle.

  • You want a full export in a text form you can search with an editor.

It might not be feasible to run a full XML export regularly (such as nightly). So if jobs are running, best practice to speed up the full export (and to help prevent issues with importing the data later) is to use the --excludeJobs option. Read more information about the ectool export command on page Using the CloudBees Flow Perl API.

Preparing for a Backup

Before you backup your CloudBees Flow server:

  • Make sure you have plenty of free space available because full database dumps and XML export files can be extremely large.

  • Compress database dumps if they are not compressed by default.

  • Regularly perform maintenance such as, but not limited to:

  • Pruning job workspaces

  • Deleting or compressing CloudBees Flow log files

  • Deleting unused projects and/or procedures

You can use CloudBees Flow to perform backups by creating a procedure that runs the database dump or export command.

Backing Up a CloudBees Flow Server

Use the following procedure to back up your CloudBees Flow server data. Review Preparing for a Backup before performing this procedure.

  1. Choose one of the following methods to back up your data:

    • Use a database-specific backup tool to create a database dump.

    • Use ectool export to create a complete XML database backup.

      For more information about database backup methods, see Data Backup Methods .
  2. Save the passkey file. The full path name of this file is:

    • Linux: /opt/electriccloud/commander/conf/passkey

    • Windows: C:\ProgramData\Electric Cloud\ElectricCommander\conf\passkey

When you restore your server, this passkey must be in place so CloudBees Flow can decrypt passwords for user impersonation, LDAP, and the database connection.

  1. Back up the plugins directory.

    • The plugins directory is stored in a server setting property ( /server/settings/pluginsDirectory ).

    • If the property does not exist, the server uses the default location, which is the plugins subdirectory in the data directory.

  2. Back up the files containing your custom configurations and settings to ensure all important settings are saved.

    • The default location for CloudBees Flow server and agent configuration files is the conf subdirectory in the data directory.

    • The default location for the Apache web server configuration files is the `apache/conf ` subdirectory in the data directory.

  3. Verify that your backup contains the following items:

    • Database dump and/or XML export

    • The passkey file

    • The contents of the plugins directory

    • Configuration files

    • Keystores