Topic: Ive got a badly designed database and wanted to pass data to a new one

please guys, Im going to make a rails version of a php system, Ive just put my hands into the database and of course it f..ing sucks HARD, really, whoever made this got programming all wrong, if Im to use the database as it is Im gonna have to learn how to program again in the shitty way sad

so, could someone point me on how could I make a script to catch data from the horribly designed db and pass it to a decent one Im gonna write?

there's a huge load of data...

Re: Ive got a badly designed database and wanted to pass data to a new one

Write a Ruby script that will use 2 connections, - one with the 'bad DB' and the other one with your new 'cool' DB. Then retrive what you want and save it to the appropriate model.

Re: Ive got a badly designed database and wanted to pass data to a new one

I've done this before.  What I had to do was define classes for each of the new database tables.  You can define new classes as separate .rb files and include them in the main script for building the new database.  Presumably you will have a main table that will have relations to it and what is important is that the relations are added simultaneously per entry of the main table using an all or non method.  The all or non is important to maintain stability of the database.  For ruby you will need the appropriate db include file.   

This is assuming you might modify the new database to be normalized.  If not, just use the old one, and build the rails app creating the changes as you go along.  You will loose information but as long as you keep a back up you ca always retrieve the old information.