Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
/ ar-dbcopy Public archive

small utility to copy data from on dbms to another via active_record

License

Notifications You must be signed in to change notification settings

siebertm/ar-dbcopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AR_DBCopy

Simple script to copy data from one database to another. This script can be used to migrate from one Database system to another one, e.q. when the SQL dumps are not compatible. Database agnosticism is achieved by using ActiveRecord.

The script just defines 2 connections, looks at the tables, creates ActiveRecord model classes on-the-fly and copies over the data.

Configure the databases using the database.yml.example as a template (the format is the same as Rails’s database.yml)

Then, run the script. The script only copies data, not structure, so make sure that you created the schema and all tables in the destination database already (use rake db:schema:load)

Example

ARDBCopy.new("database.yml", :copy_schema => true).run!

This software was written in less than an hour. So it may contain bugs!

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Author: Copyright © 2009 Michael Siebert <[email protected]>

About

small utility to copy data from on dbms to another via active_record

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages