Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created September 21, 2011 15:38
Show Gist options
  • Save jasonroelofs/1232407 to your computer and use it in GitHub Desktop.
Save jasonroelofs/1232407 to your computer and use it in GitHub Desktop.
Quick script to use the ar_dbcopy gem for moving data between databases.
##
# Script to copy over data from mysql to postgres
#
# gem install ar_dbcopy --ignore-dependencies
#
# db_copy.yml needs to look like:
#
# source:
# adapter: mysql
# host: localhost
# username: root
# password:
# database: bloomfire_dev
#
# target:
# adapter: postgresql
# host: localhost
# username:
# password:
# database: bloomfire_dev
##
require 'rubygems'
require 'mysql'
require 'pg'
require 'ar_dbcopy'
ARDBCopy.new("db_copy.yml").run!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment