Importing Legacy Data

I have a rather large legacy dataset thats not already in SQL, is there
anyway I can use Rails to import this data programmaticly? Im already
considering converting the database to Rails code so that it (rails) can
handle the relationships (inserts in to join tables and such). Perhaps
something very similar to the scaffolding code, but more along the lines
of Rails tests?

Does this make sense? Can someone provide me with some
tips/info/examples for doing such? Maybe there is even a rails plugin?
or ruby gem?

Thanks in advance.

Perhaps my question was a bit vague, or because it likely encompasses a
large variety of solutions and hacks and the import script isnt really a
functional part of the Rails app, I guess I can understand the lack of
answers. I think writing a ruby script that uses ActiveRecord (for
handling associations) might be the way to go.

Jonathon M. wrote:

I have a rather large legacy dataset thats not already in SQL, is there
anyway I can use Rails to import this data programmaticly? Im already
considering converting the database to Rails code so that it (rails) can
handle the relationships (inserts in to join tables and such). Perhaps
something very similar to the scaffolding code, but more along the lines
of Rails tests?

Does this make sense? Can someone provide me with some
tips/info/examples for doing such? Maybe there is even a rails plugin?
or ruby gem?

Thanks in advance.

On 3-aug-2006, at 20:32, Jonathon M. wrote:

Perhaps my question was a bit vague, or because it likely
encompasses a
large variety of solutions and hacks and the import script isnt
really a
functional part of the Rails app,

Write it as a a migration.

Julian ‘Julik’ Tarkhanov
please send all personal mail to
me at julik.nl

hi,

2006/8/3, Jonathon M. [email protected]:

I have a rather large legacy dataset thats not already in SQL, is there
anyway I can use Rails to import this data programmaticly?

It depends… you don’t say in which format it is, if it’s mappable
(more or less easily) into tables/relationships.

If it comes in some sort of text file you may use ruby to process
those building (and executing) the migrations dynamically (or using
ActiveRecord).
Another way might be transforming it in YAML and loading it as a
fixture…

HTH
Luca

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs