Allen J. Hall

Materials Science & Engineering, Productivity, and Life

How to backup/save/resurrect your Stanza iPod/iPhone eBook Library

calibre_stanzaA recent Stanza update for the iPod Touch and iPhone left me with a completely blank ebook library!  horror!! So, not being content with doing things the most straight forward way, and redownloading every book, I decided to see if you could get all your books back from Stanza somehow.  To learn how, join me after the jump…

First, a few caveats:

  1. We’re going to resurrect the book files from your most recent iPod backup.  [You did have a most recent iPod backup, right?]
  2. We’re going to lose all our info about bookmarks and books read etc. etc. with this approach.  Since we’re mostly concerned with the actual books, I’m not going to worry about this.  I just didn’t want to try to remember what I had downloaded, and for more obscure sources, some books may have needed to be reconverted etc.  [ugh]
  3. We’re going to dabble in the command line (Terminal.app) – if that frightens you, I don’t know what to tell ya.  You’re probably better off redownloading everything inside Stanza itself.
  4. I may miss quoting a few sources in this one, in an attempt to get the info out quickly, if you find I’ve used info you authored, please get in touch so I can properly give you credit.
  5. I find the Mac (osX) to be the most versatile computer, and so this is only going to be focused on osX.  You may however find that portions of the following work for Windows and Linux (sorry those two are in the same sentence penguin guys- no slight meant).

Second- let’s get to it…

  1. You need a program that can work on the iPod backup files (.mdbackup files usually located in your user/library/mobilesync/ folder).  For this, I used: MobileSync-Inspect (it works with 10.4.x and also other os’s).
  2. To make it easy to peruse the files available inside the .mdbackup files, I ran a simple command to save the output of mobilesync-inspect to a single text file:
    ./mobilesync-inspect list >currentbackup.txt
  3. Now, I found the files for the books located here: more currentbackup.txt |grep Documents/Library/
  4. So, first step is simply snagging copies of the total contents of the library to a folder on the desktop. I first create a folder “StanzaLibraryResurrection” on the desktop…
  5. Then, snag all the library into the folder: ./mobilesync-inspect backup Documents/Library/* ~/Desktop/StanzaLibraryResurrection/
  6. Once that is complete (will take a while) you may want to backup the folder just to save some time in case you mess something up- label it red to avoid confusion and only copy out of it when needed.
  7. Now, peruse the folders a bit.  You’ll see something like this:
    Extracted Folders from .mdbackup
  8. Notice the folders with the syntax #.explode? Those are the book ePub files in unzipped format. I wish they were saved zipped, however, we can fix that. [Stanza likely unzips them to speed up library surfing.]
  9. An ePub file is pretty much everything inside one of those numerical folders zipped up. You can have a look around and see the structure. Notice the content.xml files and the .opf and mimetype etc. These all have a purpose. For more info, you may find this page helpful (and it includes a sample.epub file): ePub Tutorial
  10. Now, don’t just go zipping the folder up. I tried that for a few hours before coming across the important tidbit that the “mimetype” file must be uncompressed within the zip! Complex! Finally with some digging, I found that the following command will work for you if you open the terminal inside the folder of the ebook you want to convert (for instance …/Library/0/10/ ): zip -Xr9D 10.epub mimetype *
  11. So, if you’ve accomplished that last one, you’ve successfully resurrected 1 book from your iPod backup that contained your Stanza library! The only thing left to do is to get it back into your iPod.
  12. If you haven’t already been doing this, I’m glad you’re about to, because it’s quite a nice thing to be able to do… if you delved into this tutorial, you probably already are doing this, and so you can skip the rest of the steps- you already know what to do. ;) Go grab Calibre!! Calibre is like an ebook iTunes… well, sort of. It’s not super graceful, but it does the job and does it well. It’s getting even better with each new release. And guess what- it’s FREE! [The all important price-point for a graduate student.]
  13. Once you have Calibre installed, “Add” your newly created ePub ebook. It should autodetect all the metadata for you, and you should have a line in your library with all the book info! :) Nice.
  14. Finally, to get it on your iPod/iPhone, go to Preferences in Calibre, and startup the content server. Then open Stanza, and use the URL listed in Calibre (with your computer’s ip address!) to surf to your shared library and download your ePub straight into Stanza on the iPhone. A more detailed discussion of how to do this and setup ISBN and cover image searching can be found here: 101:iPhone+Stanza+Calibre

In order to speed up the process, I may make a little applescript or shell script… but time is tight, so if you have questions, feel free to add them in the comments here. I’ll try to get to them when I have a free moment. Good luck!!

8 Comments

  1. Joe
    Posted April 25, 2009 at 5:41 pm | Permalink

    Great post! Although there is an easier way to recover your books in the event of a bad update http://www.lexcycle.com/faq/restoring_from_backup

  2. Posted April 25, 2009 at 8:45 pm | Permalink

    Hi Joe!

    Thanks for swinging by and linking to that post on Lexcycle.com! I appreciate it. :) If I had seen that, I probably wouldn’t have learned how to do this, so, I’m kinda glad I hadn’t. I have a number of texts I converted and stored in Calibre already, and now with this method, I have a backup of everything I used to have in Stanza in Calibre. It even allows me to send it to other readers if needed in various formats, so I’m glad for that extra functionality (although I’m not using it right now)… not to mention you can read via the computer epub readers.

    Addendum: If you find a file that has no extension and is just a number say: “13″, try simply adding the .epub extension and dropping it onto Calibre. I’ve found that those files for some reason are still uncompressed (perhaps they were never opened in the Stanza app?).

    The process is quite simple- I really should make a helper program for it in applescript…

  3. Posted April 25, 2009 at 9:31 pm | Permalink

    BTW, there is a wonderful series on the backup files located on the Oreilly blog written by Erica Sadun:

    http://blogs.oreilly.com/iphone/2008/05/iphone-backups-part-1.html
    http://blogs.oreilly.com/iphone/2008/06/iphone-backups-part-2.html
    http://blogs.oreilly.com/iphone/2008/06/recovering-data-from-mdbackup.html
    http://blogs.oreilly.com/iphone/2008/06/iphone-backups-part-4.html

    She also has a program mdhelper that runs on 10.5.x and above.

  4. Shane
    Posted January 4, 2010 at 6:03 pm | Permalink

    You don’t need to bother with this stuff. There are files that are just a number with no extension in the directories. Rename these to .epub and import to your ipod. It worked fine for me.

  5. Posted January 4, 2010 at 6:15 pm | Permalink

    Shane- thank you for dropping by! You are correct- there’s an “unzipped” version of the book, and a zipped version of the book- as you know, the zipped version is literally the .epub. It should have the proper compression on each component. I noticed something like this was happening when you downloaded a book and didn’t open it in Stanza.

    Thanks for posting, Shane, and I appreciate your confirmation of what I suspected. I just never got around to trying it, so my hat is off to you for doing so, sir!!

    If I get to it, I’ll try and put together a little applescript-studio program for grabbing the epubs out of the iphone/ipod backup.

    Please drop in again, and thank you for your much needed post!!
    -Allen

  6. shasta
    Posted July 29, 2010 at 8:56 pm | Permalink

    i tried to install after installing safari 5 your mobilesync app but i get an error about corefoundation.dll is missing? help please. thanks, shasta

  7. shasta
    Posted July 29, 2010 at 8:59 pm | Permalink

    oh, i am on win xp sp3 and i have an ipod touch 1g 32gb. hoping to get a 4g but we’ll see if it really has the camera…otherwise i think i’ll go for the ipad. Anyhow, i need to restore and rejailbreak thanks to apple screwing up the sync with itunes update. i don’t want to lose my game data though i’m somewhat resigned to the fact that it’s more likely i will than won’t. shasta

  8. shasta
    Posted July 29, 2010 at 9:01 pm | Permalink

    yes, i’m a dweeb.. not your app. going to other website! but if you happen to know why it’s happening and a fix that’d be great too.
    thanks, shasta

    apparently failed reading 101.

Post a Comment

Your email is never shared. Required fields are marked *

*
*

A Quick Introduction...

I'm a graduate student (PhD Candidate) at the University of Illinois at Urbana-Champaign.

I've studied and researched in two fields of Materials Science and Engineering (Polymers and Semiconductors). My interests are as diverse as my musical tastes and I usually have my hand in some crazy project during my free time.

I'm available for consulting and have access to a world-renown materials research user-facility supported by the D.O.E. If you would like to know more, please contact me.

Popular Tags

Amazon Associate Link Apple Support AppStore Bug CIGS CIS CLI Conferences Cross Platform Data Mining data visualization dual-driver headphones failure Friend Geek Tool Great Scientists HAM Radio Hardware Tips How To Humanitarian IEM IM In-Ear Monitors iPod Touch LaTeX Linux Mac OsX Materials Science and Engineering Matlab Obituary Open Source problem Productivity reciprocal space return Silent Key Software Software Review Support This Blog Thesis Writing Tip UIUC VOIP Windows xrd

Support This Blog

You can support this blog by shopping on Amazon through my Affiliate Store.