mdkent / knife-backup

knife plugin to help backup and restore a chef server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Knife-Backup

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
  • 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

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

Installation

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

Usage

For a list of commands:

knife backup --help

Currently the available commands are:

knife backup export [-D DIR]
knife backup restore [-D DIR]

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.

Todo/Ideas

  • Timestamp for the backup folder
  • Limit the backup to just some objects (for ex, just backup the cookbooks or just the nodes)
  • Track the failed downloads and report them at the end
  • Find out if there is a way to overwrite a client object.

Development

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

Authors

Created and maintained by Marius Ducea (marius.ducea@gmail.com)

Based on the original plugins by Steven Danna and Joshua Timberman

License

Apache License, Version 2.0 (see LICENSE)

About

knife plugin to help backup and restore a chef server.

License:Apache License 2.0


Languages

Language:Ruby 100.0%