0.0
No commit activity in last 3 years
No release in over 3 years
Sync database tables between production & development using mina.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 3.0

Runtime

>= 1.0.6
>= 10.0
 Project Readme

Mina Db Sync

Copy specific tables between your production and development databases using Mina for your Rails app. All authentication is based on your database.yml files.

Requirements

  • rsync

Installation

Add this line to your application's Gemfile:

gem 'mina-db_sync'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mina-db_sync

Now add the following to your config/deploy.rb file:

require 'mina/db_sync'

# configure which database you're using:
set :db_sync_database, 'postgres' #or 'mysql'

# optionally turn on debugging, which leaves the sql file after sync:
set :db_sync_debug, true

Usage

Get data from the server to your local db:

mina db:get_tables

Get data from your local db to the server:

mina db:put_tables

You'll be asked to supply the name(s) of any database tables you'd like to be copied over. All data in the target table(s) will be removed as part of the process, so make sure you backup first if you're paranoid.

Or you can specify the tables you want from the beginning:

$ mina db:get_tables[table1,table2,table3]

If you're using Zsh:

$ mina db:get_tables\[table1,table2,table3\]

Database Support

  • MySQL
  • Postgresql

License

The gem is available as open source under the terms of the MIT License.