How do I rollback to an Enterprise Chef 11.3 system after upgrading to Chef Server 12.2?

Peter Burkholder -

chef-server-upgrade -- This is not an endorsed or recommend upgrade path. Test upgrades on a separate clone if at all possible


All commands are 'root'


Validate your current install passes tests

private-chef-ctl test

Stop things in sane state

private-chef-ctl reconfigure
private-chef-ctl stop
/bin/rm -f /etc/opscode/chef-server.rb #  (settings will be copied from private-chef.rb)

Make the backups

# Backup just the data and configs:
for i in \
  "`find /var/opt/opscode -name "data" && find /var/opt/opscode/rabbitmq -name "db"`"; do
    tar -cvpf $chefbackup $i;

tar --append -pvf $chefbackup /etc/opscode --exclude /etc/opscode/chef-server-running.json
bzip2 $chefbackup

# Backup everything -- we shouldn't need it, but just in case
tar -czpf /var/chefall.tgz /var/opt/opscode /etc/opscode

Verify the backup

ls -lh $chefbackup.bz2 # should be 8M at a min
bzip2 -d -c $chefbackup.bz2 | tar -tf -   # should see lots of files

Get the RPM onto the box for the current version and the next version

curl -L \ \
  -o /root/chef-server.rpm -vs
curl -L \ \
  -o /root/private-chef.rpm -vs

Do the upgrade

rpm -Uvh --nopostun /root/chef-server.rpm
chef-server-ctl upgrade  # go get coffee
chef-server-ctl start


On chef-server machine

chef-server-ctl test

on clients


on workstation

knife node list
knife node search '*:*'
knife cookbook upload ...

If keeping chef-server-12:

After the upgrade process is complete and everything is tested and verified to be working properly, clean up the server by removing all of the old data:

chef-server-ctl cleanup


chef-server-ctl stop
rpm --erase chef-server-core
rpm -Uvh --nopostun /root/private-chef.rpm

Cleanup the database files

RM='/bin/rm -rf'
for i in \
  "`find /var/opt/opscode -name "data" && find /var/opt/opscode/rabbitmq -name "db"`"; do
    $RM $i;
    $RM /etc/opscode

Restore databases and test

bzip2 -d -c $chefbackup.bz2 | tar -C / -xvf -
private-chef-ctl reconfigure
private-chef-ctl start
private-chef-ctl test

Also the tests above for the upgrade

Done with upgrade/rollback

Have more questions? Submit a request


Powered by Zendesk