Migrating to Chef 12 Server from Chef 10


#1

Hey Guys,

We’re finally at a point where we can upgrade from Chef 10 server. Is it
possible to use this procedure (https://www.chef.io/blog/2013/03/12/5106/)
to migrate the data on the 10 server to the 12 server, or do we need to go
to an 11 server first and then upgrade to 12?

Thank you in advance.

-J


#2

Yes, it should be possible, although you would need to setup your Chef 12 server and create an org and make sure you then uploaded the data to that org on the Chef 12 server, since Chef 12 make multiple orgs open source, when it had not been before. You’d want to do try this on a test system first, as there will likely be gotchas in there on how you need to change the data to make it all migrate nicely.

Otherwise going from 10 to latest 11 to 12 will handle all of that for you. Here are the docs on upgrading from open source 11 to 12: https://docs.chef.io/release/server_12-4/upgrade_server.html#from-chef-server-osc

The code that is doing the 11 to 12 upgrade lives here: https://github.com/chef/chef-server/blob/master/omnibus/files/private-chef-ctl-commands/open_source_chef12_upgrade.rb

That will give you an idea of what is happening under the hood (like the 10 to 11 upgrade, it’s a download, transform, and upload process) and might help you determine what you need to do to jump from 10 to 12.

  • Mark Mzyk
    Chef Engineering Manager

#3

Sorry for the non-response. For some reason your reply didn’t get sent to my Gmail. We went ahead and upgraded all of our Chef Clients to 11.18.12 (with the server still at 10) to get the cookbooks into shape and ensure they were working.

Right now I’m trying to upload the data to the Chef 12 servers using “knife upload” (I did set the URL to /<org_name>) with a repo_mode of “everything”, but I’m running into this error about 70% of the way through the upload:

Here’s the full traceback when run with -VV:

Any advice is greatly appreciated.

-J


#4

See if you find this helpful:
https://github.com/chef/chef-web-docs-2016/issues/637


#5

My guess is that your Chef 10 data is not conforming to what the Chef 12 server is expecting. Chef server 12 has a completely different permission system that is based off the Enterprise Chef line. It looks like on the upload it’s looking for the key for a user that likely doesn’t exist.

Your best best is to understand the data transform we do in the Chef 11 server to Chef 12 server upgrade process and understand what is likely missing that you need to put in place.

See this method in particular: https://github.com/chef/chef-server/blob/master/omnibus/files/private-chef-ctl-commands/open_source_chef12_upgrade.rb#L72

It does some magic to extract the needed keys from the Chef 11 server, which you’ll likely need to figure out how to do for Chef 10: https://github.com/chef/chef-server/blob/master/omnibus/files/private-chef-ctl-commands/open_source_chef12_upgrade.rb#L381

Further in the upgrade process it makes the data conform to the expected format for Chef 12: https://github.com/chef/chef-server/blob/master/omnibus/files/private-chef-ctl-commands/open_source_chef12_upgrade.rb#L96

I’m not certain how much of this knife upload is taking care of for you. It likely handles this well for the cookbooks (and I’m assuming you’ve already created an org). What it seems to be choking on is the users.

Hope that helps.


#6

What I ended up doing:

1.) Booted up a clean Vagrant with Chef Server 11.1.7
2.) Imported the cleaned up Chef 10 data with “knife upload” (no problems)
3.) Installed Chef Server 12.4.1 on the Vagrant box and ran “chef-server-ctl upgrade”. Again no problems.
4.) Exported the data with "chef-server-ctl backup -y"
5.) Setup the actual new Chef server clean with 12.4.1 and restored the backup (in process now).

-J


#7

That works. Glad you found a solution that worked.


#8

Yeah it worked great. It would be probably help other folks if there was a Chef 10 section in the upgrade docs for 12. Given the pain of moving between major versions of Chef, there are probably others who also skipped 11.

-J