Transfering SQLite3 to MySQL and back
June 4th, 2008
The Easy Way
I previously posted my script for transferring from SQLite3 to MySQL here with involved step by step instructions. I’m going to mention it again with ultra simplified instructions to make it easier to digest and to save time for people who know what they are doing.
Here they are:
- Set up a development DB using SQLite3 (presumably you already have one from working locally)
- Set up a production DB using MySQL
- (optionally) Make sure they work
- Install the plugin in the
vendor/pluginsfolder - Run the script with
rake db:backup:to_db TARGET_DB=production
Tip If you don’t have a development DB and set up your local install as production, just change your database.yml file to say that production is development…
Tip I typically bootstrap my production DB before I migrate over. It works and all the bootstrap data gets wiped.
Tip Use this carefully and please back up your original DB before you transfer over. If you get the syntax backwards you will wipe your data.
Tip Both databases have to be the same structure before doing the transfer. So you have to migrate your extensions and make sure your source DB is using the same version of Radiant as the destination DB.
