Skip to content

Instantly share code, notes, and snippets.

@jeremymv2
Created August 16, 2016 13:15
Show Gist options
  • Save jeremymv2/e2601bc73087e585f475dc3821fab607 to your computer and use it in GitHub Desktop.
Save jeremymv2/e2601bc73087e585f475dc3821fab607 to your computer and use it in GitHub Desktop.

Migrating from an Existing Chef Server Install

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.

  1. Ensure your existing install is running the latest version of Chef Server (12.4.1).

  2. 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.

  3. Move the tarball created in Step 2 onto a frontend node in your new Chef Backend-based cluster.

  4. 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.

  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment