[chef] Re: Re: migrating from chef 11 to chef 12 server


Chronological Thread 
  • From: Mark Mzyk < >
  • To:
  • Subject: [chef] Re: Re: migrating from chef 11 to chef 12 server
  • Date: Mon, 13 Oct 2014 10:56:29 -0400

Hey Bethany,

I wanted to follow up on what Stephen said and make sure you have all the information you might need. What Stephen said is correct. When you upgrade from the open source Chef Server 11 to Chef Server 12 it is essentially a clean install. The Chef Server 12 package installs into a different location than the open source Chef Server 11 (/opt/opscode instead of /opt/chef-server). The upgrade process makes use of this fact to download the data from the Chef Server 11, transform it on disk, then upload it to the Chef Server 12. Currently the automated process assumes you're doing a standalone install of one server to the next on the same box, but this certainly doesn't have to be the case.

To do an install from one box to another, you can use the upgrade subcommands provided, which are documented here:  http://docs.getchef.com/upgrade_server_open_source_notes.html#subcommand-reference

These commands, if run serially, are exactly the same as running the upgrade command. To have access to these commands, you need the Chef Server 12 package installed on the box you are going to use them on (the server does not have to be configured yet, the package just has to be installed on the box). All the subcommands take the form chef12-upgrade-*. So you could use the chef-server-ctl chef12-upgrade-download option to download everything from the Chef Server 11 (note that right now this will stop your Chef Server 11 after it completes the download - if you don't want this, you can run a knife download yourself against the Chef Server 11 and it will produce the same data as this command, so long as you tell knife download to download everything. We're working to make this experience nicer.). After you run this command, it will point you to a tmp directory where all the data was saved (you can also specify a directory to the command. I recommend you run -h on all the subcommands to see the various options available). If you transfer this data to the Chef Server 12 box, you can then pick up with the chef12-upgrade-transform command and finish with the chef12-upgrade-upload command and it will complete the upgrade for you and bring up your Chef Server 12.

Given that we've open sourced all of the Chef server now, all of this code is also open sourced, which is here: https://github.com/opscode/opscode-omnibus/tree/master/files/private-chef-ctl-commands

In this case the code is all Ruby. The files in question you want to view are upgrade.rb, which kicks off the process, open_source_chef12_upgrade.rb which contains all the logic for doing the upgrade, and then the three files chef12-upgrade-*, which serve as entry points into the upgrade process if the subcommands talked about above are used. Note that the subcommands just reuse the same code as the upgrade process.

And just for completeness, I'll note the docs for the normal upgrade path are located here: http://docs.getchef.com/server/upgrade_server.html#from-chef-server-osc

I'll also note that when doing the upgrade, in the interest of ensuring the process loses none of your data (we don't expect it to, but this involves computers, so the unexpected will happen), nothing is deleted from disk. This means after an upgrade that the downloaded Chef Server 11 data will still be on disk, as will the transformed data that is uploaded to the Chef Server 12. If you do this upgrade on a single box, it is also up to you to remove the Chef Server 11 package from the system. You can either backup or delete the data that is on disk as you'd like. The upgrade process will tell you where this data is located in a message at the end, or you can use the command line flags to specify where you'd like it located. One benefit of not removing the Chef Server 11 automatically is that if something does go wrong with the upgrade to Chef Server 12, you can turn off the Chef Server 12 and restart the Chef Server 11 (although you will need to point at the Chef Server 11 ctl command yourself, since Chef Server 12 shares the same chef-server-ctl naming. The Chef Server 11 ctl command is located at /opt/chef-server/bin/chef-server-ctl. If you remove Chef Server 12 from the system then this won't be an issue, but as long as both share the same system it will be).

That's probably more information that you wanted, but if at any point you have any questions, feel free to email this list or you can seek me out in the #Chef IRC room. I'm mmzyk.

Thanks,

Mark Mzyk

" type="cite">
" photoname="Stephen Delano" src="jpgAWSUgREBOO.jpg" name="postbox-contact.jpg" height="25px" width="25px">
October 9, 2014 at 11:59 AM
Hi Bethany,

An in-place upgrade from an open source Chef Server 11 to Chef Server 12 actually runs the knife-backup / knife-restore processes under the covers. This will also have the end result of starting with a new instance of the server, where the underlying database is completely fresh. Chef 12 installs to /opt/opscode and the associated data dirs are in /var/opt/opscode where Chef 11 was /opt/chef-server and /var/opt/chef-server.

If your desires of a fresh instance are more around wanting a new hardware instance (or a new VM), then there are also commands that will allow you to export the data and import it to the new server. The process around export / import is a bit more involved than simply a knife upload / download, so I'll find those docs and link you to them shortly.

Thanks!
Stephen




--
Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104
" photoname="Bethany Erskine" src="jpgd86xoFDnTj.jpg" name="postbox-contact.jpg" height="25px" width="25px">
October 9, 2014 at 11:08 AM
Is doing a full export of the data (using knife backup) from one server running open source Chef Server 11 then importing the data into a new instance running a fresh install of Chef Server 12 a supported upgrade path? I've reviewed the docs here, but if possible, I would prefer to start fresh with a new instance of chef server rather than upgrading the existing one in place.  

thanks,
Bethany
--
Bethany Erskine
Senior Technical Operations Engineer



Archive powered by MHonArc 2.6.16.

§