I have an existing chef-server setup with around 300 nodes registered to it. Now I would like to move to another chef-server with an updated version. However I am not sure of how we can migrate all the nodes and other data from older chef-server to the newer one.
There are multiple steps here and some information is needed from you to better answer your question.
Assumptions
Steps
a) First make sure you have inventoried your current chef setup so you know what all your node names are and what run-lists are applied to each node.
b) SSH into a node you want to move and delete /etc/chef/client.pem
c) Now login to your new Chef server and use the private key in /etc/chef/chef-validator.pem contents to create /etc/chef/validation.pem on your client machine.
d) Edit /etc/client.rb and change the chef_server_url to whatever your new chef server is.
Now run chef-client on the client machine. This will create a new client identity from the new server and you should see the name of your client appear in your chef server's the /clients listing of your new Chef server.
But you're not out of the weeds yet because: i) your clients run-list will be empty and ii) this client does not yet appear in the /nodes listing of your new server.
d) So you need to use the
knife node create NODE_NAME
command from your workstation to name the node and log it in your new chef server's database.
Then use
knife node run_list add NODE_NAME RUN_LIST_ITEM(s)
to re-create the run-list for each box.
Then use
knife node environment_set NODE_NAME ENVIRONMENT_NAME
to set the environment for each node.
Now run chef-client on the node and you should see the node in /nodes with the run lists and environments you assigned. You should also see the node in the status tab with a very recent Last Check-in time.
Yes. You would have to do this 300 times. Ow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With