Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Join the chat at

Knife-Backup is a Knife plugin that can help you backup and restore a chef server. It is based on the great work of Steven Danna and Joshua Timberman on the BackupExport and BackupRestore plugins. Currently knife-backup has support for the following objects:

  • clients
  • users (chef 11 - Open Source)
  • 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

Users are a bit tricky, knife-backup can't gather the crypted passwords via the chef server so it's forced to reset them to a random string on restore. Be sure to copy them from the restore output or reset them.

Known limitation: currently it is not possible to overwrite a client object already available on the target server and these will be skipped.


You will need chef installed and a working knife config; it should work with chef versions newer than 0.10.10

gem install knife-backup


Currently the available commands are:

knife backup export [component component ...] [-D DIR] [options]
knife backup restore [component component ...] [-D DIR]

knife backup export cookbooks roles environments -D ~/my_chef_backup

Optional Switches for export

  • -N, --latest only download the latest version of a cookbook
  • -I, --ignore-permissions ignore any permission errors during export

Optional Switches for restore

  • -I, --ignore-metadata-errors Ignore json metadata errors when restoring cookbooks

For more information on commands:

knife backup SUB-COMMAND --help

Note: you should treat this as beta software; I'm using it with success for my needs and hopefully you will find it useful too.


  • Timestamp for the backup folder
  • Track the failed downloads and report them at the end
  • Find out if there is a way to overwrite a client object.


Pull requests are very welcome! Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


Created and maintained by Marius Ducea (

Based on the original plugins by Steven Danna and Joshua Timberman


Apache License, Version 2.0 (see LICENSE)


knife plugin to help backup and restore a chef server.







No packages published