[LRUG] Migrating SQLlite to MySQL

Alexander Bienz abienz at gmail.com
Mon Nov 16 09:45:02 PST 2009


Yes, that's the kind of thing,

I'm thinking this tool maybe useful

http://blog.heroku.com/archives/2007/11/23/yamldb_for_databaseindependent_data_dumps/



On Mon, Nov 16, 2009 at 1:06 PM, Matthew Rudy Jacobs <
matthewrudyjacobs at gmail.com> wrote:

> I assume what you want to do is;
>
>    - tag your current code with the database.yml pointing to sqlite
>    - make the necessary changes to point to your mysql instance
>    - tag this version of the code
>    - put up a maintenance page (make apache or nginx return 503 status
>    code, and say "please be patient. we're busy making blahblah.combetter. see you in a moment" - capistrano can do most of this for you)
>    - dump your sqlite database ("sqlite3 db/production.sqlite3 '.dump' >
>    dbdump.sql")
>    - load this into your mysql ("mysql my_database_production <
>    dbdump.sql")
>    - now redeploy your code with the mysql tag of your code
>    - restart your server
>    - take down the maintenance page.
>
>
> 2009/11/16 Alexander Bienz <abienz at gmail.com>
>
>> Hello folks,
>>
>> I've been managing a personal priject on the Rails 2 framework for a year
>> or so, and I initially left the production Database as SQLlite, as I wanted
>> to see how it would perform.
>>
>> I would now like to use a MySQL database, as is typical for most Rails
>> webapps, but I want the changeover to be seamless, I don't want to lose any
>> data or connections.
>>
>> Can anyone point me in the direction of the best practice for this kind of
>> migration?
>>
>> Any tips would be appreciated.
>>
>> Cheers,
>>
>> Alex.
>>
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20091116/1041a653/attachment-0003.html>


More information about the Chat mailing list