A link to my GitHub page with the script to re-map databases:
https://github.com/slugbucket/ruby-db-table-remapper
Where this is really going to work for me is migrating a database developed on MySQL to a production instance on SQL Server.
A link to my GitHub page with the script to re-map databases:
https://github.com/slugbucket/ruby-db-table-remapper
Where this is really going to work for me is migrating a database developed on MySQL to a production instance on SQL Server.
I’m working on converting an infrastructure inventory application from Rails 3 to 4 but since this was one of my early Rails app (written several years ago) I thought I’d take the opportunity to straighten a few pieces out:
Now, this will involve a serious amount of data porting (hundreds of hosts, application and databases and supporting details in roughly 60 tables) and I really didn’t fancy editing a large mysqldump file so I decided to write a script.
For no particular reason I decided to use YAML to describe the tables, the columns to read and write to as well as allowing different source and target table and column names. As it turned out not a bad choice.
It’s taken me a day to write the script (and it is particularly ugly even by my standards) but it will save several days worth of effort doing the migration and it will of course allow the process to be done repeatedly.
Although it is a horrible script, I’m likely to post it on my GitHub page for future reference and because I might try and clean it up sometime.