3

I have Puppet server version 2.6.4 that was manually installed using RPM packages directly (instead of using Yum to fetch packages from a repository).

Now I want to upgrade it to the latest version (3.6), as safely as possible, by installing it using the Puppet Labs repository and Yum.

In case something goes wrong, how can I rollback the change? What should I do to backup the current setup before upgrading?

gtirloni
  • 5,746
  • 3
  • 25
  • 52
KK Patel
  • 385
  • 4
  • 17

1 Answers1

5

CentOS 5 has a nifty way to rollback your system. On update, it can rebuild packages with the configs that are present at that time.

Configure RPM to repackage packages that will be altered by adding the following line to /etc/rpm/macros:

 %_repackage_all_erasures 1

Create the file if not present.

Next, configure yum to handle this transaction-scenario, by adding the following line to /etc/yum.conf:

tsflags=repackage

When you decide you need to do a rollback, you can do so by using rpm --rollback. Examples:

rpm -Uhv --rollback '19:00'
rpm -Uhv --rollback '8 hours ago'
rpm -Uhv --rollback 'december 31'
rpm -Uhv --rollback 'yesterday'

Info originally taken from here.

Of course it will not hurt you, if you make a backup of your configurations, just in case ;)

Sgaduuw
  • 1,833
  • 12
  • 16