Puppet Foreman Version 1.16.2 migrate all data to Puppet Foreman Version 3.4.1

We want to update Puppet Foreman 1.16.2 , when the update fails we decide to land a brand new VM with newly installed Foreman Puppet Version 3.4.1 .

Now we need to migrate all hosts and all puppet configurations and classes, in other words migrate data.

We want to find a solution how we can migrate all the necessary information from the old system and start using the updated environment.

We tried to restore the old Puppet Foreman PostgreSQL database to the new Foreman Puppet, but after restoring the new Foreman Puppet stops working.

Hey there !

I don’t really have a specific answer to your problems but I have some insights about a similar situation.

We have an “old” Foreman 1.11 with a second smart proxy maintaining the configuration of roughly 6000 servers. 12 different Linux flavors, 4 Windows versions. Split between bare metal and 3 different Hypervisors for virtualization.
The poor thing was in bad shape, on an OS that the company was no longer willing to spent time maintaining, and we were having performance issues. Long story short, we had to find a solution.

Migrate the old infrastructure or build a new one.

TLDR; We were not able to migrate with certainty and ease, and it would have been at a huge cost (both man hours and financially). We built a new infrastructure and left the “old” datas to die with the old platform while migrating all the hosts with Ansible playbooks.

So, the long story …

We have an old Foreman 1.11 and a secondary smart proxy, running outdated Puppet servers and agents packages. We have both version 3 and 4 of the puppet agent running on all the hosts. The database running all “that” is on MySQL.

The work was to migrate all “that” to an up to date OS with up to date packages for the OS and the softwares (Puppet/Foreman). Also, plan for upgrading all the hosts with the new up to date agent shortly after that (because version 3 and 4 agents could not talk to the new puppet servers).

So after having analyzed the work to do, which was migrating across 3 OS, 2 database technologies and several other little adjustments, we decided it was way too much work to migrate the old platform to a new one.
Instead we decided to build a new one, up to standards and with all the bells and whistles :slight_smile:

We currently are in the process of migrating all the hosts on the old platform to the new one (Foreman 3.4/ Puppet 7), and only 40% of the total hosts are left to be migrated. You know how it is with “change management” :smiley:

We have the remote execution feature up and running (on Linuxes) and are in the process of enabling the “build” feature.

We are are using custom tailored Ansible playbooks (nothing too fancy tho) to ensure that the migration of the hosts is proceeding in an orderly fashion. And we are migrating hosts at a pace of 200 a week ATM with ease. We are also taking some time to tweak the old Puppet code and bring it to the current standards ad well.

Everything is relying on Git repos and is versioned.

Hopes this will give some insights.

3 Likes

Hello,
Thanks for answer.
Wit Foreman/Puppet we managing only windows OS computers, thefore with ansible its complicated.

We we transfer the classes from the old puppet server to the new one, we can already see them in the new foreman. But now we need to see all the hosts.

Hello again!

So, if the classes/modules you’re using are getting along well with your new setup, that’s great.

In order to “migrate” all your Windows hosts to your new platform I would suggest:

  1. Set up your Puppet CA to autosign certificates for the duration of your migration
  2. Update/upgrade the Puppet Agent on the host PRIOR to migration
  3. Migrate all your hosts with the admin CLi/Powershell on the host itself
    (command line. Like: puppet agent --test --onetime --noop --server foreman.example.net --ca_server foreman.exemple.net --environment my_sql_servers)

It’s tedious, but it’s getting the work done.

P.S.: My Deutch/German is pretty bad. So unfortunately, I will only be able to help in either English or French. Let me know! :slight_smile:

Hi!
Here is our story of success :slight_smile:
We have updated Foreman from 1.16 to 1.24 and now we are preparing for update to 3.2 at least. You need to update Foreman database step by step. I mean 1.16 → 1.17 → 1.18 and so on… It is strictly necessary to iterate over all of versions between your current version and the target one. There are a lot of changes in database structure in every foreman version, that applying during migration process.
So, the typical update process contains these steps:

  • stop foreman
  • backup db
  • upgrade foreman
  • run migrations (execute foreman-rake db:migrate)
  • run seeds (execute foreman-rake db:seed)
  • start foreman
    And so on for every new Foreman version.

I hope, this will be usefull.