Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A gem providing a rake task for backing up and migrating databases and files between rails instances.
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE
README.textile
Rakefile
rails-backup-migrate.gemspec

README.textile

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.

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

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

Something went wrong with that request. Please try again.