You should back up your existing CloudBees CD/RO data frequently. CloudBees recommends 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 CD/RO ectool export
tool to create a complete XML database backup. This section describes the differences between the two types of backups.
CloudBees recommends 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 CD/RO 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. For more information about the ectool export command, refer to Use the CloudBees CD/RO Perl API.
|
Preparing for a backup
Before you back up your CloudBees CD/RO 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 CD/RO log files
-
Deleting unused projects and/or procedures
-
You can use CloudBees CD/RO to perform backups by creating a procedure that runs the database dump or export command. |
Backing Up a CloudBees CD/RO Server
Use the following procedure to back up your CloudBees CD/RO server data. Review Preparing for a Backup before performing this procedure.
-
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, refer to Data Backup Methods.
-
-
Save the
passkey
file. The full path name of this file is:-
Linux:
/opt/cloudbees/sda/conf/passkey
-
Windows:
C:\ProgramData\CloudBees\Software Delivery Automation\conf\passkey
When you restore your server, this passkey must be in place so CloudBees CD/RO can decrypt passwords for user impersonation, LDAP, and the database connection.
-
-
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.
-
-
Back up the files containing your custom configurations and settings to ensure all important settings are saved.
-
The default location for CloudBees CD/RO 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.
-
-
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
-