To migrate from an existing Chef Server install requires exporting the data from your existing installation and importing it to the new installation, using tooling that ships with the Chef Server.
-
Ensure your existing install is running the latest version of Chef Server (12.4.1).
-
On your existing installation, create an export (as root):
/opt/opscode/embedded/bin/knife ec backup PATH -c /etc/opscode/pivotal.rb --with-key-sql --with-user-sql tar cvf export.tar.gz PATH
NOTE: The PATH argument should be a location with enough disk space to hold all of the data on your Chef Server, including all cookbook data. Running
du -sc /var/opt/opscode/*
on your backend node (or your standalone Chef Server) can help determine how much space is needed. Since the exported representation of your Chef Data is larger than the in-database representation of the data, we recommend ensuring you have 3-4 times more space than is currently being used by your Chef Server. -
Move the tarball created in Step 2 onto a frontend node in your new Chef Backend-based cluster.
-
Extract the export:
tar xvf export.tar.gz
NOTE: By default this will extract to a path relative to your current working directory. If this directory does not have enough space, use the
-C DIR
option to extract in a different directory. -
Import the extracted export:
/opt/opscode/embedded/bin/knife ec restore /path/to/extracted/backup/ --with-key-sql --with-user-sql -c /etc/opscode/pivotal.rb --sql-host VIP_OF_CHEF_BACKEND
NOTE: VIP_OF_CHEF_BACKEND should be the configured virtual IP of the Chef Backend cluster that your new Chef Server cluster is using.