Make Chef Server backup remotely; for Chef Server 11 and 12
211
Debian Jessie with knife-backup 0.0.11 gem. Base image: ruby:2.2.3-slim. To make Chef Server backup remotely. For Chef Server 11 and 12.
It won't backup/restore Chef Server 12 users, because of such knife-backup limitation.
Assuming that:
Run this docker image e.g. like this:
$ docker run --rm --name chef_server_backup -v ~/.chef/admin.pem:/root/.chef/admin.pem -v /var/backups/chef-server/:/var/backups/chef-server/ -e CHEF_SERVER_URL="https://chef.example.com/organizations/testorg" --link chef_server:chef.example.com xmik/chef-server-backup:0.0.1
where:
/var/backups/chef-server/ inside container
or all your backup will be inside container only (it will be lost if using
docker run --rm)CHEF_USER, default is adminPEM_PATH, default is /root/.chef/${CHEF_USER}.pemCHEF_SERVER_URL, default is https://chef.example.com/organizations/testorg ,
for Chef Server 11 the part "organizations/testorg" is not neededKNIFE_COMMAND, default is knife backup export cookbooks roles environments clients users nodes -D /var/backups/chef-server. A good example for testing maybe KNIFE_COMMAND="knife backup export environments -D /var/backups/chef-server".
so actually, you can change this command to knife backup restore cookbooks roles environments clients users nodes -D /path/to/exported_backup -y
and use this image to restore Chef Server backupBuild an image using the tag from script/version.txt. Use rake task:
$ rake build
Size of xmik/chef-server-backup:0.0.1 is 492 MB.
Content type
Image
Digest
sha256:811079cb4…
Size
179.1 MB
Last updated
almost 11 years ago
docker pull xmik/chef-server-backup:0.0.1