Sunday, 4 November 2012

iOS Notes Export

Whilst performing some housekeeping on various backups, I happened across a directory holding my iPhone and iPad application backups. Thats a lot of space for backups, but I was a regular iPhone user of about 30 months, and throughout that time I created about 10 notes a week, mostly with design related ideas.

When it came time to move to Android, I found that there was no way to export these notes. Hundreds of notes were tied into the iOS ecosystem and I needed to Jailbreak them.

Well, yesterday I decided to scan through my 40GB backup files (all filenames were hashed) for plain-text of some of the more obscure notes I made (via the excellent Agent Ransack). I found three files, each with a similar hashed name, each of a similar size, each in a different folder with a different timestamp.

The more recent files were larger than the less recent ones. I broke out my trusty Notepad++, and spotted that the files did indeed contain my note text body, but that the file was a binary format. Luckily, the file also contained the string SQLite. Could it be that simple?

I decided to see if the file would open up in SQLite Browser and it did. The notes format was pretty straight forward. There was a table for notes and note metadata and a separate table for the body of notes (stored as HTML body text).

As I'm a Java guy, I decided to see if there was a JDBC driver for SQLite and found one by Xerial that did the trick. It took less than an hour to put together the SQLite query, the basic GUI, the CSV exporter (including escaping special characters), then about another hour to put together the Maven build, about another hour to import it into GitHub and to set up the web page (effectively a formatted version of the README).

After working alone for several years full time on a massive codebase (not yet published), it was so much fun to take time out to solve a small problem and to go from inception to publishing in a single evening. So far, I believe I've had zero downloads (if you exclude my own download). I do hope someone finds a use for this product at someday, but if not, at least my notes are now liberated and I had a fun time solving the problem.

Website : iOS Notes Export