Switching to a new Chef server

The administrator of the Chef organization

Download the validation key

Do this only once for the organization.

This step resets the validation key, so the existing server images will not be able to connect to the Chef organization.

  1. On the Administration tab on the left select Organizations > Reset validation Key
  2. Click the Reset Key button,
  3. This is the only time you are able to download the validator key. Click the Download button to save it on your workstation.

Every user

Download your personal key from the server and configure knife. See DevOps Engineering part 4. – Connect to the Chef server

Upload all cookbooks to the new Chef server

  1. Copy all cookbooks to the new chef directory
  2. Open a terminal in the cookbooks directory and start to upload all cookbooks
    knife cookbook upload --all --freeze --force
  3. When you get the message

    ERROR: Cookbook XXX depends on cookbooks which are not currently
    ERROR: being uploaded and cannot be found on the server.
    ERROR: The missing cookbook(s) are: ‘YYY’ version ‘>= 0.0.0’, ‘ZZZ’ version ‘>= 0.0.0’

    1. Change to that XXX cookbook directory and execute
      berks upload
  4. Repeat step 3 until all cookbooks have successfully uploaded to the server.

Upload the environment files

  1. Open a terminal in the environments directory.
knife environment from file qa.json uat.json prod.json

Upload the data bags

  1. Open a terminal window in the data-bags directory and upload the data bags.
knife data bag create MY_DATA_BAG
knife data bag from file MY_DATA_BAG MY_DATA_BAG/MY_ITEM1.json
knife data bag from file MY_DATA_BAG MY_DATA_BAG/MY_ITEM2.json
knife data bag from file MY_DATA_BAG MY_DATA_BAG/MY_ITEM3.json



Leave a comment

Your email address will not be published. Required fields are marked *