Forge Home

pe_migrate

A series of tasks used to migrate a PE installation.

1,752 downloads

1,212 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.2.4 (latest)
  • 0.1.0
released Apr 28th 2021
This version is compatible with:
  • Puppet Enterprise 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 6.12.0
  • , , , , ,
Tasks:
  • agent_migrate
  • backup_transfer
  • puppet_backup
  • puppet_restore

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'coreymbe-pe_migrate', '0.2.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add coreymbe-pe_migrate
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install coreymbe-pe_migrate --version 0.2.4

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

coreymbe/pe_migrate — version 0.2.4 Apr 28th 2021

pe_migrate

Table of Contents
  1. Overview
  2. Setup Requirements
  3. Usage
  4. Advanced Usage

Overview

With the steps provided in this module you'll migrate the following components of your PE installation to a new host:

  • PE configuration, including license, classification, and RBAC settings.
  • 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.

Setup

This module should be installed on the current Puppet Primary Server (MoM).

The tasks provided in this module require the puppet-bolt and rsync packages. You can manually install these packages, or you can apply the pe_migrate::prep class to the Puppet Primary Server. This class will set up the Puppet Tools repository and install both puppet-bolt and rsync. Although you will need to manually install rsync on the target host.

Requirement: Utilization of this module also requires SSH access as root to the new host via an ssh-key.

Limitations:

Please Note: These instructions are for standard installations only. While the tasks provided in this module allow you to backup and restore your Puppet Enterprise installation on a target host, you will need to manually install PE on the target host before restoring the backup.

Additionally:

  • If you are migrating from PE 2018.1 or older, you may need to remove the class mcollective_middleware_hosts from the PE Infrastructure node group before moving to PE 2019.x.

Usage

While most of the migration can be automated with the use of these tasks, there are a few manual steps you will need to perform. Please follow the guideline below when performing a migration of your PE installation. The tasks can be ran from the command line as shown, or from the PE Console.

Migration Steps:

Step One: Backup the PE installation.

puppet task run pe_migrate::puppet_backup backupdir=</BACKUP/DIR> --nodes <PRIMARY SERVER FQDN>

Step Two: Transfer the backup.

puppet task run pe_migrate::backup_transfer backupdir=</BACKUP/DIR> targetdir=</BACKUP/DIR/ON/TARGET> targethost=<NEW PRIMARY SERVER FQDN> --nodes <PRIMARY SERVER FQDN>

Step Three: Install PE

On the new primary server, install the same version of PE.

Step Four: Restore the backup to the new PE installation.

puppet task run pe_migrate::puppet_restore privatekey=</PATH/TO/KEY> targetdir=</BACKUP/DIR/ON/TARGET> targethost=<NEW PRIMARY SERVER FQDN> --nodes <PRIMARY SERVER FQDN>

Step Five: Upgrade the new PE installation.

On the new primary server, perform an in-place upgrade to the desired version of PE by following the steps in our documentation here.

Step Six: Point agent nodes at the new primary server.

puppet task run pe_migrate::agent_migrate targethost=<NEW PRIMARY FQDN> --node-group <PE-Agent node-group-id>

Please Note: The PE Agent node group ID can be found in the PE Console under Node Groups -> PE Agent -> Activity. The ID will be in the very first entry.

Step Seven: Upgrade agent nodes.

If you migrated to a newer version of PE, upgrade the agent nodes.


Advanced Usage - Manual Migration

Before utilizing the advanced steps in this module, please make sure you are unable to use the built-in puppet-backup command to backup and restore your PE installation. An example scenario where you would be unable to use the aforementioned command would be moving to a new host OS that does support the current version of Puppet Enterprise installed.

If you are unable to use the puppet-backup command, you may be able to use the advanced manual migration steps and tasks provided in this module.