Backing Up Radiant CMS using Sqlite3
April 28th, 2008
How to Transfer from SQLite to MySQL
I noticed something while working on a couple Radiant sites. I found that when I was building them locally, I prefer to work with SQLite3 databases. Then when I deploy them they use MySQL. Since so much of the configuration and site template lives in the database, I wanted an easy way to go from SQLite to MySQL. In the end I built it!
Wouldn’t it be Nice… to Backup from MySQL to SQLite? And vice-versa?
At the same time, I always thought it would be nice to be able to create a backup of the live database in SQLite. That way, if a client ever wanted their site ‘packaged up and portable’ as it were, it would be easy, just dump the production DB into a SQLite development DB, zip up the radiant folder and you have the whole site ready to run.
My ‘Plugin’ – Installation
I created this as a plugin for Radiant. Just download the package (at the end of this entry), uncompress into your plugins folder and you’re ready to go.
How to Use it
It’s fairly simple. Make sure you have SQLite and MySQL set up and running. Then configure your installation to use a SQLite DB for development and a MySQL DB for production.
development:
adapter: sqlite3
database: db/development.sqlite3
production:
adapter: mysql
database: myradiant_production
username: radixhound
password: paSSwerd
host: localhost
Then make sure your target DB is pre-created. So if you don’t have a production DB up to this point, you can do this.
rake db:migrate
rake db:migrate:extensions
Then when you want to transfer from development to production, you can do this…
rake db:backup:to_db TARGET_DB=production
To do the reverse, you will do this…
rake production db:backup:to_db
Or Backup to another SQLite DB altogether…
You can also configure a third, fourth or fifth DB in your database.yml file and use that to back-up to, in case you don’t want to wipe out your development DB. Just add something like this to your database.yml file…
backup:
adapter: sqlite3
database: db/development.sqlite3
Then you can do this..
rake production db:backup:to_db TARGET_DB=backup
Download the Goods
radiant_db_backup.zip
radiant_db_backup.tar.gz
PS: I also have a version that works for Mephisto sites. you only get it in zip format ‘cause I have somewhere to be right now.
PPS: I figured this out from someone else’s script that did something similar-ish but not quite this. I don’t remember who or what though, sorry.
Quicksilver Funny Moment
March 21st, 2007

I had this moment of absolute hilarity just a few minutes ago. I was playing with Quicksilver and tossing tasks into my inbox for Actiontastic, when I discovered that if I jump the gun and execute a command before giving an action to it, it would do the default action “Large Type”. Basically it just splashes the text on the screen. After a couple of fumbles, I thought I would mock myself for a moment. Little did I realize how well I would mock myself – or how much it would make me laugh. I still chuckle every time I look at the screen shot.
I just had to blog about this funny moment. At the same time, I’m going to explain how I took this screenshot, renamed it and converted it to 200×200 pixels in a few seconds and without touching my mouse! All thanks to Quicksilver.
Read the rest of this entryLiquid Textmate Bundle
January 31st, 2007
I’m just posting this little article to share with the world a little liquid bundle for Textmate. It was originally created by Sebastian Gräßl but is now not available from his site. So I’m just making it available – at least for now until is becomes available elsewhere.
Enjoy!