Backing up Tumblr blogs with PHP and SQLite

I have knocked together a very simple and somewhat dirty PHP CLI script to download copies of an entire Tumblr blog through their API. I have imaginatively called it Tumblr Backup PHP. I will be adding extra features as and when I can. The first new feature on the list will be ability backup the associated Disqus comments at the same time.

This script was developed on Windows so you will need to update the PHP binary location in the top of the run.php file. More installation information is available in the readme file on GitHub.

Essentially the script uses php-rest-api by Jason Tan to download all your blog posts in 50 post chunks from the Tumblr API and Idiorm by Jamie Matthews to then save all the posts into an SQLite database.

All you need to do is update the configuration file with your blogs details and then execute run.php in your console/command prompt. You will need SQLite, cURL and PHP5 to run the script. You do not need a web server you can just install PHP on your machine and run the script from the command line just like you would with a Python or Ruby script.

There is currently no allowances for time outs when accessing the API and there is also no restore script at the moment.