[LRUG] Migrating SQLlite to MySQL

Sam Livingston-Gray geeksam at gmail.com
Mon Nov 16 09:45:42 PST 2009


> Date: Mon, 16 Nov 2009 12:52:42 +0000
> From: "Glenn @ Ruby Pond Ltd" <glenn at rubypond.com>
> Subject: Re: [LRUG] Migrating SQLlite to MySQL
>
> I wont claim this is best practice, but whenever a production
> environment db doesn't match what I use locally for dev (postgres)
> I've got a cap/rake task that pulls down the data and loads it using
> yaml_db:
>
> http://github.com/adamwiggins/yaml_db
>
> Not great if you've got loads of data on production, but handy when
> trying to debug problems. May suit your needs too.

Interesting tool, and hopefully I'll remember it if I ever need to  
migrate from one DB platform to another.

For repeated use, though, I'd be reluctant to incur the overhead of  
going through YAML and ActiveRecord.

I've used similar Capistrano tasks that run 'mysqldump' or 'pg_dump'  
on the server, make a .tar.gz from the result, scp it to the local  
machine, unpack the .tar.gz, and restore into a local copy of the same  
database.  Again, it's obviously not great for larger databases, but  
it works reasonably well for the size of app I tend to work on, and  
the native DB platform's dump/restore tools are fast enough that the  
download is usually the slowest step.

Hope this helps,
-Sam




More information about the Chat mailing list