These instructions are for an HA system specifically.
To use for a Standalone, just replace the /var/opt/opscode/drbd/data
path to /var/opt/opscode
and ignore the stages for Secondary Backend and Frontends.
All commands as root
##On the Source EC 11.0.2 system
-
Shutdown the backend
private-chef-ctl stop
-
Take a backup of the idle source Primary Backend
tar -cvpf checkbackup-source.tar /etc/opscode /var/opt/opscode/drbd/data --exclude /etc/opscode/chef-server-running.js --exclude /etc/opscode/private-chef.rb
-
Copy the tar over to the destination Primary Backend
##Destination Primary Backend System
-
Shutdown all services but keepalived on the Primary backend
for i in `private-chef-ctl status | awk '{print $2}' | cut -d ':' -f1,1 | grep -v keepalived`; do private-chef-ctl stop $i; done
-
Make a backup of the current system and save it somewhere safe
tar -cvpf chefbackup-destination.tar /etc/opscode /var/opt/opscode/drbd/data
-
Delete all the current data
rm -fr /var/opt/opscode/drbd/data
-
Extract the data from the source server. /etc/opscode/pivotal.pem should match source server, /etc/opscode/private-chef.rb should not.
tar -xpf chefbackup-source.tar -C /
-
Startup
private-chef-ctl start
-
Check for any issues in the database startup
less /var/log/opscode/postgresql/9.2/current
##On the Destination Secondary Backend System
- Copy the Primary Backend directory
/etc/opscode
here and overwrite all current stuff.
##On the Destination Frontends
-
Copy the Primary Backend directory
/etc/opscode
here and overwrite all current stuff. Reconfigure the systems. This should restart services.private-chef-ctl reconfigure
Please don't forget to copy the /etc/opscode
directory from the current Primary Backend to the Secondary Backend in the Destination cluster. We didn't do that here, and it is needed for a failover to succeed.