Migrating to Postgresql
Posted by Christopher Smith
Yesterday, the blog got an error. Surprise, surprise, my concerns about SQLite seemed to be realized, as tracing through the error it seemed the database had gotten trapped in this locked state. Now, I’m sure if I had half a clue about SQLite or Rails I might have been able to figure this out and prevent it from happening again, but I know zip about the former and am very much in the early stages of learning about the latter. So, on the “least effort” principle, I decided to carry out that migration to Postgresql I had been wanting to do anyway.
Trackbacks
Use the following link to trackback from your own site:
http://xblog.xman.org/trackbacks?article_id=migrating-to-postgresql&day=09&month=09&year=2006
The next time you have to do a migration like this, you might want to look in to using Rails’ “migrations” to do as much. If you look in one of the testing-related “Rakefiles” (we’ll not discuss my anger over things like “rake” and “ant” when good old make works perfectly well enough, thank you very much) you’ll find code for transferring the schema from the dev to the test database. You could kluge that in to transferring between two arbitrary databases without too much trouble. From there it shouldn’t be too difficult use the models and move the data over. You could probably even avoid the ID problem this way.
Note that this would almost certainly take more time than the way you did it, but.. um.. maybe you could throw some big fonts and spinners in and have it be all web 2.0 and somehow a good idea.