GithubHelp home page GithubHelp logo

isabella232 / knife-backup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cvent/knife-backup

0.0 0.0 0.0 56 KB

knife plugin to help backup and restore a chef server.

License: Apache License 2.0

Ruby 100.00%

knife-backup's Introduction

Knife-Backup

Join the chat at https://gitter.im/mdxp/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
  • 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.

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

Currently the available commands are:

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

#Example:
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.

Todo/Ideas

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

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 ([email protected])

Based on the original plugins by Steven Danna and Joshua Timberman

License

Apache License, Version 2.0 (see LICENSE)

knife-backup's People

Contributors

brentm5 avatar erkki avatar gitter-badger avatar grobie avatar josephholsten avatar logikal avatar machavity avatar mdkent avatar mdxp avatar mic92 avatar pmoosh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.