Forum: Ruby on Rails using rails to migrate between databases

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9d79da034ee21c2aa1304e3c02e993eb?d=identicon&s=25 Nobody Else (nyxx)
on 2007-02-19 13:15
Hey people,

I have the following question to present to you all. I need some basic
information about how to use rails to migrate the dataset of my project
between two types of database systems.

First, the live data now exists in MSSQL and also uses a very poorly
designed database scheme.

Next, the data needs to be migrated to MySQL, also using a completely
re-designed schema, where tables have transformed and sometimes even
dropped.

How (in very general lines) woudl I accomplish this using ruby on rails?
I'm not really looking for any detailed examples or anything, just a
place to start.

Thanks in advance,

danny
1c9625363fbc59a97151af80d6e93af5?d=identicon&s=25 Theron Parlin (tparlin)
on 2007-02-19 13:29
(Received via mailing list)
Assuming your application is running in rails already, you can run
'rake db_schema_dump'. This will create db/schema.rb, which you can
then modify before importing into your MySQL database by running 'rake
db:migrate'. If you're not already running Ruby on Rails, you could
always set up a new rails application and point it to your current
MSSQL database (instructions here:
http://wiki.rubyonrails.org/rails/pages/HowtoConne...).

Good luck.

On Feb 19, 7:15 am, Daniel Owen van Dommelen <rails-mailing-
9d79da034ee21c2aa1304e3c02e993eb?d=identicon&s=25 Nobody Else (nyxx)
on 2007-02-19 13:32
Theron Parlin wrote:
> Assuming your application is running in rails already, you can run
> 'rake db_schema_dump'. This will create db/schema.rb, which you can
> then modify before importing into your MySQL database by running 'rake
> db:migrate'. If you're not already running Ruby on Rails, you could
> always set up a new rails application and point it to your current
> MSSQL database (instructions here:
> http://wiki.rubyonrails.org/rails/pages/HowtoConne...).
>
> Good luck.
>
> On Feb 19, 7:15 am, Daniel Owen van Dommelen <rails-mailing-

I do not think this is an option for me since I'm working with an
enormous database.

There was a hint I got from the person who's managing this project and
it was somewhat in the line of using SQL queries to get the data into
the code and then using this data I have to create the models to support
the new database layout.

any thoughts on that?

Thanks!
9d79da034ee21c2aa1304e3c02e993eb?d=identicon&s=25 Nobody Else (nyxx)
on 2007-02-19 13:34
by the way, the old database scheme is not following the rails
conventions...
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2007-02-19 13:47
(Received via mailing list)
Do schemas differ a lot structuraly? Are relations more or less
preserved structuraly at least?

-- fxn
9d79da034ee21c2aa1304e3c02e993eb?d=identicon&s=25 Nobody Else (nyxx)
on 2007-02-19 13:59
Xavier Noria wrote:
> Do schemas differ a lot structuraly? Are relations more or less
> preserved structuraly at least?
>
> -- fxn

no the schema are pretty much complete different, also relations have
been totally redesigned. The old schema has been done by a student who
created it as his internship project, but has really dropped the ball
back then. This is also one of the reasons I had to complete redo the
database, about a year later now.

I might have found my information though. I'm diving into DBI module,
and it thusfar is proving to be the thing I was looking for... If anyone
is interested follow this link:

http://www.kitebird.com/articles/ruby-dbi.html

thanks for the attention people!
31254903db793bf6f84bbd607fe092fd?d=identicon&s=25 Anthony Eden (Guest)
on 2007-02-19 22:27
(Received via mailing list)
Daniel,

You might be able to use ActiveWarehouse ETL to extract from the old
system, transform the data as necessary and load into the new system -
that's what it was designed for (although primarily for data
warehouses but there is nothing that locks it into that).

More info: http://activewarehouse.rubyforge.org/etl

V/r
Anthony

On 2/19/07, Daniel Owen van Dommelen <rails-mailing-list@andreas-s.net>
wrote:
> back then. This is also one of the reasons I had to complete redo the
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
Cell: 808 782-5046
Current Location: Melbourne, FL
This topic is locked and can not be replied to.