Backing up and restoring Puppet Enterprise
Sections
Keep regular backups of your PE infrastructure. Backups allow you to more easily migrate to a new primary server, troubleshoot, and quickly recover in the case of system failures.
puppet-backup
command to back up and restore your
primary server. You can't use this command to back up compilers. By default, the backup
command creates a backup of:-
Your PE configuration, including license, classification, and RBAC settings. However, configuration backup 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 backup time.
-
PuppetDB data, including facts, catalogs and historical reports.
Each time you create a new backup, PE creates a single,
timestamped backup file, named in the format pe_backup-<TIMESTAMP>.tgz
. This file includes everything you're
backing up. By default, PE writes backup files to /var/puppetlabs/backups
, but you can change this location
when you run the backup command. When you restore, specify the backup file you want to
restore from.
If you are restoring to a previously existing primary server, uninstall and reinstall PE first. If you are restoring or migrating to a primary server with a different hostname, you can redirect your agents to the new primary server during the restore process. In both cases, you must restore to the same PE version used to create your backups. If your installation includes disaster recovery, you must complete the restore process before reprovisioning a new replica.
Customizing backup and restore scope
By default, backup and restore functions include your Puppet configuration, certificates, code, and PuppetDB. However, you can limit the scope of backup and restore with command line options. This allows you to back up to or restore from multiple files. This is useful if you want to back up some parts of your infrastructure more often than others.
For example, if you have frequent code changes, you might back up the code more often than you back up the rest of your infrastructure. When you limit backup scope, the backup file contains only the specified parts of your infrastructure. Be sure to give your backup file a name that identifies the scope so that you always know what a given file contains.
During restore, you must restore all scopes: code, configuration, certificates, and PuppetDB. However, you can restore each scope from different files, either by restoring from backup files with limited scope or by limiting the scope of the restore. For example, by specifying scope when you run the restore command, you could restore code, configuration, and certificates from one backup file and PuppetDB from a different one.
Back up your infrastructure
PE backup creates a copy of your primary server, including configuration, certificates, code, and PuppetDB. Backup can take up to several hours depending on the size of PuppetDB.
pg_repack
won't run prior to or during
the backup/restore process. /var/puppetlabs/backups
.Restore your infrastructure
Use the restore commands to migrate your primary server to a new host or to recover from system failure.
pg_repack
won't run prior to or during the
backup/restore process. Directories and data backed up
These are the directories and data included in PE backups.
Scope | Directories and databases backed up |
---|---|
certs
|
|
code
|
|
config
|
|
puppetdb
|
|