Hello. I’m building a chef 12 standalone server, and trying to knife upload all
of our data into it from our chef 11 server.
How do I load users from the chef 11 server to chef 12? I’m trying, but failing
as seen below. This technique has worked for us when uploading users to a chef 11 server.
And, for these uploaded users, to what Org are they associated? Since the ORG_NAME endpoint is in my knife.rb below, I assume it uses that Org? (And how do I make some of theses users admin users? so many chef 12 questions…)
You can use the upgrade tooling packaged with the Chef 12 server to do what you want, you’ll just need to add a manual step of copying over the data from the old server to the new one.
As far as how that will setup an org, you’ll set a default org that all the migrated data will be associated with during that process.
If anything isn’t clear, ask and I’ll try to provide clarification. Do note that for the tooling to work your Chef 11 server has to be at least version 11.1 or greater. If it isn’t, upgrade to the latest 11 version and then proceed. (I’m assuming you’re running open source Chef 11 server and not Enterprise Chef 11).
The thing is, we don’t want to upgrade our chef 11 server in place. We want to
build a fresh chef 12 server and load data into it from backups. Given this
dir structure, this all works, except for uploading the users.
[transfer]# ls -l
total 132
drwxr-xr-x 2 root root 40960 Oct 21 18:20 clients
drwxr-xr-x 592 root root 32768 Oct 21 18:30 cookbooks
drwxr-xr-x 21 root root 4096 Oct 21 18:20 data_bags
drwxr-xr-x 2 root root 4096 Oct 21 18:20 environments
drwxr-xr-x 2 root root 40960 Oct 21 18:21 nodes
drwxr-xr-x 2 root root 4096 Oct 21 18:20 roles
drwxr-xr-x 2 root root 4096 Oct 21 18:20 users
Let me apologize for misspelling your name in my other post. Sorry about that Kallen.
Yes, what I linked to talks about how to do what you want. The upgrade tooling will allow you to do this. You install the Chef 12 package on the Chef 11 server, but never run reconfigure. This will give you access to the upgrade commands, but without changing your Chef 11 server (Chef 11 and Chef 12 servers install in different directories - they can live side by side, although both can’t be running at the same time. In fact, the automated upgrade when run against a Chef 11 server is a full download from the Chef 11 server, transform the data, and upload to the Chef 12 server all on the same box). Installing the Chef 12 package on a Chef 11 server will change the default path to chef-server-ctl to that of Chef 12, but you can use the direct path of /opt/chef-server/bin/chef-server-ctl to continue to access the Chef 11 server’s chef-server-ctl (Chef 12 installs to /opt/opscode/).
These are the three steps that make up an upgrade. So you can run the download step, then the transform step on your Chef 11 server. This will save your data by default into a folder under /tmp, but you can specify the location via a command line option. Transforming the data will move the data into the format expected by the Chef 12 server and will again by default save it to a folder under /tmp. (As an aside, this data is mostly json laid out in a particular folder structure - so you can go in and inspect it and even modify it if needed). The output will tell you the name of this folder if you don’t change the default. Then you copy this transformed data over to your new Chef 12 server and the on the Chef 12 server run the upload step to complete the process. The three commands I’ve described here were put in place exactly for a scenario just like this. If you run chef-server-ctl upgrade --help you can see all the options associated with the commands. We attempted to make this process very flexible to enable various upgrade scenarios. The one thing we didn’t get implemented is running the process on a new Chef 12 server box and pulling from a remote Chef 11 server box. I’d wish we’d gotten to that, but we didn’t, so for now it remains a manual step to copy over the data.
Just as side note: as long as your chef client is over 11.8 (IIRC, but prefer a 11.18 if possible, personnaly Iit went well with a 11.16.4) there’s no problem migrating in place to a chef12 server from opsource chef11 server.
The migrations process is correct enough so you can rollback at any time to the chef server 11 if anything goes bad.