Giter VIP home page Giter VIP logo

rails-backup-migrate's Introduction

Rails Backup Migrate

A gem that provides a rake task for backing up your database and uploaded files to an archive and restoring them from an archive.

You can archive schema, schema+data, files, or schema+data+files. Each archive action has a restore counterpart. The data from the database is backed up to a .yml file for each table that is database independent.

So you can use Rails Backup Migrate to get data out of one kind of database and easily load it into another kind.

Quick Start

Installing the gem:

  $ gem install rails-backup-migrate

Add the following line to your rails application’s Rakefile

  require 'rails-backup-migrate'

To backup everything in a rails instance:

  $ rake site:backup

Everything is saved in an archive file, named by default ‘site-backup.tgz’. Copy/move this to another rails instance

  $ rake site:restore

More info

The backup file can be specified with a command line argument in rake’s (wierd) format:

</code>  $ rake site:backup[/path/to/file.tgz]

Compatibility

Tested initially on ‘redmine’ using rails 2.3.11 and some simpler tests with rails 3. Has been tested with MySQL and Sqlite3 databases. Further testing with postgres to be done.

Also tested with a dummy rails 3.0 app using sqlite3 driver in ruby 1.8.7, 1.9.2 and jruby 1.6.2.

This requires a system with access to the `tar` command in your path. (Easy for Mac & *nixes, may require a posix environment such as cygwin under Windows.)

Known Issues:

- under ruby 1.9.2, the YAML export (in the `rake site:backup` task fails extended characters in ASCII to UTF8 conversion) (Github Issue #4) Changes made in 0.0.9 that look like this is fixed – any help regressing is welcome!

Contributors

Matt Connolly – main author of gem
Tobias Lütke – wrote a `backup.rake` file that inspired the database backup portion.

License

GPL – See LICENSE

rails-backup-migrate's People

Contributors

mattconnolly avatar

Stargazers

Adam Weller avatar

Watchers

Adam Weller avatar James Cloos 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.