Back up and restore PE
Use the Puppet Enterprise (PE) backup tool to create regular backups of your installation. Then, if you migrate your primary server to a new operating system or replace your primary server hardware, you can restore your installation. The backup and restore process can also be useful for troubleshooting or for recovering your installation after a system failure.
The PE backup tool is designed for backing up and restoring standard or large PE installations. For extra-large installations, consider using an alternative backup or snapshot process.
- Use the
puppet-backup create
command to back up the primary server. - When necessary, use the
puppet-backup restore
command to restore the primary server and your PE infrastructure.- Disaster recovery consideration
- If your PE installation includes disaster recovery, then after restoring the primary server, you must remove the existing replica and provision a new one.
- Back up PE on your existing primary server.
- Install a new PE primary server on a node with the upgraded operating system.
- Restore the PE backup on the new primary server.
- For installations with compilers:
- Remove existing compilers and install new compilers on the upgraded operating system.
- For installations with disaster recovery:
- Remove the existing replica and provision a new replica on the upgraded operating system.
puppet-backup
command to back up or restore the following components: - The replica of your primary server
- Compilers
- Secret keys
Customize scope of backup and restore
You can use the --scope
option to customize what data
is backed up or restored.
puppet-backup create
command backs up the
following data, and the puppet-backup restore
command
restores the same data:- Your PE configuration, including license, classification, and RBAC settings. However, the configuration backup data does not include Puppet gems or Puppet Server gems.
- PE CA certificates and the full SSL directory.
- The Puppet code deployed to your code directory at the time of the backup.
- PuppetDB data, including facts, catalogs and historical reports.
puppet-backup
command does not
include secret keys. You must back up this data separately and securely.If you want to have discrete backup files, or if you want to back up some parts of your
infrastructure more often than others, you can use --scope
command line option to limit the scope of a backup or restore. The
--scope
option accepts one or more of certs
, code
, config
, or puppetdb
. If
unspecified, the default value is all
. For details about
what is and isn't included in each scope, refer to Directories and data in backups.
For example, if you have frequent code changes, you might back up your Puppet code more often than you back up the rest of your infrastructure. When you limit the backup scope, the backup file contains only the parts of your infrastructure that you specify. Be sure to identify the scope in your backup file's name so you know what each file contains.
When you restore your primary server, you must restore your Puppet configuration, certificates, code, and PuppetDB data. However, you can restore each aspect from
different files, either by using backup files that have limited scopes or by limiting
the restore scope. For example, by limiting the scope when you run the puppet-backup restore
command, you could restore Puppet code, configuration, and certificates from one
backup file, and then restore PuppetDB from a different
backup file.
puppet-backup restore
command multiple times,
restoring a different file each time, until you have restored all four data sets
(configuration, certificates, code, and PuppetDB).Back up your infrastructure
The backup process creates a copy of your primary server, including configuration, certificates, code, and PuppetDB. Backup can take several hours depending on the size of PuppetDB.
puppet-backup
command to backup
your PE configuration, PE
certificates, Puppet code, and PuppetDB data. For details about the data included in backup
files, refer to Customize scope of backup and restore.Each time you use puppet-backup
to create a new backup,
PE creates a single backup file containing everything
you're backing up (defined by the --scope
). PE writes backup files to /var/puppetlabs/backups
, unless you specify a different location in the
puppet-backup
command. The file name follows the
default naming convention (pe_backup-<TIMESTAMP>.tgz
), unless you specified a different name in
the puppet-backup
command.
Restore your infrastructure
Use the restore process when you migrate your primary server to a new operating system or to a new host. You can also use the restore process to recover your installation after a system failure.
You must have created backup files, as described in Back up your infrastructure.
You must import the GPG key pair (both the public and private keys) that you used for encryption to your new primary server. The GPG keys are required to decrypt an encrypted backup.
Directories and data in backups
These directories and data are included in PE backups.
A default puppet-backup
command captures all scopes,
meaning all directories and data described in the table below. However, you can use the
--scope
option to limit the contents of backup files,
or to restore data from multiple backup files, as described in Customize scope of backup and restore. In this case, the --scope
option indicates which directories and data to back up or
restore.
Scope | Directories and databases |
---|---|
certs (PE
certificates) |
|
code (Puppet
code) |
This scope captures the Puppet code deployed
to your code directory at the time of the backup. Specifically:
|
config (PE
configuration) |
This scope captures your PE configuration,
including license, classification, and RBAC settings. Some directories and data
are excluded, such as Puppet gems, Puppet Server gems, and directories captured in other
scopes. Specifically, it includes:
|
puppetdb (PuppetDB) |
|