Code Monkey home page Code Monkey logo

hosted-chef-migration's Introduction

hosted-chef-migration

Migrate your data off of Hosted Chef to a private Chef server

Assumptions

There are various assumptions made here, please carefully take these into account as this may not be a one-size-fits-all.

  • This is migrating Basic data only (cookbooks, environments, roles, data_bags, nodes, clients, acls)
    • containers, cookbook_artifacts, groups, policies, policy_groups are not included in this document
  • You utilize an admin user with full privileges on both Chef servers
  • The end goal is to only have to change chef_server_url in each node's client.rb - keeping existing client certificates.
  • You are prepared to be responsible for your own organization's Chef Server. That server is already monitored (OS + Chef services), backed up, you have ensured network routing from clients -> your Chef Server works, you can manage a linux system, capacity is appropriately planned and accounted for, and it is tuned for the number of clients you're migrating to it.

Set up a monolythic repo for the migration

chef generate repo migration-repo

Create a knife.rb for SRC and DST

Reference an admin user with full privileges.

cd migration-repo

cat <<EOF> knife_src_server.rb
current_dir = File.dirname(__FILE__)
chef_server_url          "https://manage.chef.io/organizations/jeremyinc"
node_name                "jmillerv2"
client_key               "#{current_dir}/jmillerv2.pem"
versioned_cookbooks true

EOF

cat <<EOF> knife_dst_server.rb
current_dir = File.dirname(__FILE__)
chef_server_url          "https://my.company.com/organizations/lob1"
node_name                "jmex2"
client_key               "#{current_dir}/jmex2.pem"
versioned_cookbooks true

EOF

Download ALL the objects from Managed Chef Server

Take care to reference the chef-repo-path created above.

knife download --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_src_server.rb /

Upload the objects to your private Chef Server

knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /cookbooks
knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /data_bags
knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /environments
knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /roles
knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /nodes
knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /clients
knife upload --chef-repo-path ~/Devel/ChefProject/migration-repo -c knife_dst_server.rb /acls

Change the chef_server_url

At this stage, you should have all the base data on the target Chef Server. Take one node from your fleet that you are comfortable testing with and change chef_server_url in the client.rb file, pointing it at the new target Chef Server.

Trigger a chef-client run on that node - it should converge without issue. If it is successful, make the client.rb change on the rest of your fleet in stages (via cookbook_file, template_file or chef-client cookbook) - ensuring that nodes are checking in on schedule.

hosted-chef-migration's People

Contributors

jeremymv2 avatar

Stargazers

John Daniels avatar

Watchers

James Cloos avatar

hosted-chef-migration's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.