Skip to end of metadata
Go to start of metadata



If you run your own Open Source Chef Server and want all the benefits of configuration management with none of the adminstration hassle, you can migrate to Hosted Chef without losing the work you've already done. Here's how...


Benefits

As a Hosted Chef Customer you...

  • are free from managing your own Chef server(s) as your business scales. You get back to focusing on core business essentials.
  • benefit immediately from new versions of Chef and the Opscode API when they are released. Data migrations and backwards compatibility are taken care of by Opscode, virtually eliminating the work that may be required for major upgrades.
  • don't worry about scalability. As you move from tens to hundreds to thousands of systems under management, Hosted Chef will gracefully handle the load, with no concurrent increase in management overhead.
  • are protected by an industry-leading SLA and 24x7x365 support options, giving you the confidence to run mission-critical systems.

Approach

Migrate by taking the following actions:

1. Prepare your backup.

  • Run the knife plugin to backup your existing Chef Server:

This will export from the chef server all data bags, roles, environments, and nodes, storing them as JSON files within the .chef/chef_server_backup directory.

These JSON files will later be uploaded to Hosted Chef in step 5.

2. Create your accounts and organization on Hosted Chef.

See Setup Opscode User and Organization for detailed instructions on creating a new organization. Rather than creating a new, local chef repository, you can reconfigure your current repository to use Hosted Chef.

  • Replace .chef/knife.rb with the version provided by the Management console.
  • Move your Hosted Chef user's authentication key into the .chef directory, and
  • Move your Hosted Chef organization's validator key into the .chef directory.

3. Confirm that your new Opscode Hosted Chef organization has no nodes and just the validator client

The only client that should be listed is your organization's validator client. No nodes should be listed.

4. Register your existing servers with Hosted Chef

Use a custom Knife Bootstrap template to populate the nodes with the correct configuration file and validation certificate, delete the existing client certificate, and run chef-client to register the node as a new API client to the Opscode Hosted Chef Organization.

If your nodes are running a Microsoft Windows platform, you will need to use the Knife Windows Bootstrap and modify the template for the Windows platform. Be sure to remove the client.pem file, typically c:\chef\client.pem.

Note This assumes, as above, that your Hosted Chef organization has no data for these nodes. The run list will be empty. We will populate that from the backed up node data in a later step. It is important to bootstrap the nodes at this stage before restoring the backup, in order to avoid creating a permissions issue.

  • Save the following script as .chef/bootstrap/migration.erb within your chef repository. Note if you customized the client.rb, you will need to modify this script.
  • Run this bootstrap on each of your nodes. The exact command will depend on how your environment is configured. To run this on a node running Ubuntu you may execute the command:

5. Upload data to your Hosted Chef organization

You can restore the node data using a Knife Plugin (backup_restore.rb):

Alternatively, can upload the data by hand:

  • node data
    For each of the files found in the nodes directory of your chef backup, do the following:

    Running this command will repopulate the newly created nodes with their previous run_list and attributes.

  • cookbooks
    From a chef repository configured to use hosted chef and containing all of your cookbooks do:
  • roles
    For each of the files found in the roles directory of your chef backup, do the following:
  • data bags
    For each of the files found in the data_bags directory of your chef backup, do the following:

6. Run chef-client on all of your nodes

Depending on your environment, this could be done via knife ssh:

Questions on the migration?

Open a Hosted Chef ticket with any questions or issues encountered, or send an email to support@opscode.com.

Need Specialized Assistance?

If you have a particularly complex environment, and would like to seek Professional Services assistance, please contact us with your needs and we'll go over the possibilities with you.







Hosted Chef


Server API



Labels:
added added Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 01, 2012

    Problems uncovered while following this doc: Backup & restore scripts don't cover cookbooks. Document doesn't mention migrating cookbooks, or migrating older cookbooks that may be required by pinned environments.