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?

2
  • Which Linux distribution are you using?
    – Sgaduuw
    Sep 1, 2014 at 7:09
  • I am using centos-5 64bit.
    – KK Patel
    Sep 1, 2014 at 7:15

1 Answer 1

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 ;)

1
  • seems useful, I am going to trying it.
    – KK Patel
    Sep 1, 2014 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .