Backing up and restoring the deployment server
While there are many techniques for backing up and restoring servers, the following procedure backs up the minimal set of data needed for a successful recovery.
How you choose to back up the deployment server data varies depending on how you deployed the deployment server and the backup and recovery strategy and infrastructure of your organization. Regardless of the technique that is chosen, it is important to test both your backup and restore processes.
Backing up the deployment server
- Make a directory to copy the backup data. This directory can be
anything that you choose, but you must ensure that it has enough disk
space to hold the backup data. The commands in this document use
the following directory:
mkdir /tmp/backup - If you changed the Chef server configuration
files, you must back up your changes. IBM Cloud
Manager with OpenStack sets these
values during installation; therefore, no changes are typically required.
If you used a response file for installation, you must backup the
response file and keep it with your backups so it can be used to reinstall IBM Cloud
Manager with OpenStack.
cp ~/cmwo_install.rsp /tmp/backup - Back up the certificates of the webserver.
mkdir /tmp/backup/etc cp -a /etc/opscode /tmp/backup/etc/opscode - Back up the bookshelf data.
mkdir /tmp/backup/opt cp -a /var/opt/opscode /tmp/backup/opt/opscode - Back up the postgres database. The pg_dump command
produces a consistent backup even if the server processes are running.
mkdir /tmp/backup/database su - opscode-pgsql pg_dump -c opscode_chef > /tmp/chefserver.sql exit cp /tmp/chefserver.sql /tmp/backup/database - Back up your topology, node attribute, and encrypted data bag,
secret key files. By default, these files are in your /root/your-deployment-name directory.
cp -a /root/icm/clouds/your-deployment-name /tmp/backup/ - Back up the /root/.chef/knife.rb file.
cp /root/.chef/knife.rb /tmp/backup - Back up the server SSL certificate.
cp /root/.chef/os-software-management.pem /tmp/backup - If you are using identity files rather than passwords, back up identity files of the node. The location depends on your configuration. When you deployed the node, you needed to specify either the node's password or identity file in your topology files. Check your topology files to see whether you used identity files and find their locations.
- If you customized the file-repo or the yum-repo, back up those changes.
- Compress the /tmp/backup directory and store
in a safe location.
zip -r backup /tmp/backup
Restoring the deployment server
Start with
a clean system and do the following:
- Retrieve your backup archive file that you want to restore and
extract it to /tmp/backup.
unzip backup.zip - Install IBM Cloud Manager with OpenStack. Use the response file if you used one during the initial installation.
- Apply any IBM Cloud Manager with OpenStack fix packs.
- Apply any file-repo or yum-repo changes that were made or restore those changes from the backup archive file.
- Restore the postgres database.
su - opscode-pgsql psql -U opscode-pgsql opscode_chef < /tmp/backup/database/chefserver.sql exit - Stop the server processes.
chef-server-ctl stop - Restore the bookshelf data.
rm -rf /etc/opscode cp -a /tmp/backup/etc/opscode /etc/opscode - Restore chef configuration data.
rm -rf /var/opt/opscode cp -a /tmp/backup/opt/opscode /var/opt/opscode rm -f /root/.chef/trusted_certs/your_server_hostname.crt cp -a /var/opt/opscode/nginx/ca/backup_server_hostname.crt /root/.chef/trusted_certs - Restore the knife.rb file.
cp -a /tmp/backup/knife.rb /root/.chef/ - Restore the certificate of the webserver.
cp -a /tmp/backup/os-software-management.pem /root/.chef - Restore your topology, node attribute, and data bag encryption,
secret key files.
cp -a /tmp/backup/your-deployment-name /root/icm/clouds/your-deployment-name - If you are using identity files rather than passwords, restore the identity files of the node. The location depends on your configuration.
- Restart the chef server.
chef-server-ctl start - Reindex the chef server.
sed -i 's|https://127.0.0.1|https://127.0.0.1:14443|g' /opt/opscode/embedded/service/opscode-erchef/bin/reindex-opc-organization chef-server-ctl reindex ibm
Your deployment server restore is now complete.