While working on migrating a chef server from 0.10.x to version 11, I ended up extending the BackupExport and BackupRestore plugins written by Steven Danna and Joshua Timberman and added support for cookbooks and clients. Currently knife-backup has support for the following objects:

  • clients
  • nodes
  • roles
  • environments
  • data bags
  • cookbooks and all their versions.

knife-backup will backup all cookbook versions available on the chef server. Cookbooks are normally available in a repository and should be easy to upload like that, but if you are using various cookbook versions in each environment then it might not be so trivial to find and upload them back to the server; downloading them and having them available to upload like that is simple and clean. If you have too many cookbook versions then you might want to cleanup them first using something like knife-cleanup.

If you want to check it out, just install the gem:

gem install knife-backup

and then just point it to an existing chef server to backup all its objects with:

knife backup export

If you need to restore then it is simple as:

knife backup restore [-d DIR]

Hope you will find this useful and looking forward for your feedback.
Patches are welcome: knife-backup on github

comments powered by Disqus