3 ms·
Ask HN: Way to map one database schema to another?
I recently wrote a new version of a fairly popular web application. Version 1.0 was written in PHP and version 2.0 is now Python/Django.
I need a way to get my user data from version 1.0 to 2.0. I can map the columns of 1.0 to Django model fields in 2.0 (or even the database itself if necessary).
I'm looking for a tool I can use to do this. Basically, I give it a list of maps like "version1.mytable.foo" maps to "version2.mytable.bar", hit "run", and it will transfer the information from one database to another based on the maps.
Extra points if it can do the reverse as well, in case something goes terribly wrong and we have to roll back to 1.0.
Any ideas?
- attack 18y agoInteresting idea. I always just wrote a python script to do the translating and transfer.
- SwellJoe 18y agoLikewise. It turns out to be pretty easy to do. I even did it in PHP the last time I did a migration, as a way to teach myself the basics. Turned out to be more verbose than the prior Perl and Python code I'd written for the same purpose...but it worked, and still only took a few hours to write and test.
- nreece 18y agoI remember using Red Gate ( http://www.red-gate.com http://www.red-gate.com ) to do this for a fairly large SQL Server database. Which DB are you using?