+ Reply
Results 1 to 1 of 1
  1. #1
    Mes
    Mes is offline
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,026
    Thanks
    102
    Thanked 787 Times in 730 Posts

    Default Optomizing AddressBook and Calendar Databases

    My AddressBook and Calendar databases are well-used. After a month or 2 of usage I noticed thay each grown to well over 1MB. Being a curious individual, I embarked upon a task to see if they could be optimized. Yes they can

    The best solution (if you sync Contacts and Calendar with iTunes):
    1) Do a complete sync w/iTunes
    2) Use WinSCP and rename the databases to something you'll remember (like -old, or -original):
    cd /private/var/mobile/Library/AddressBook
    mv AddressBook.sqlitedb AddressBook.sqlitedb-orig
    mv AddressBookImages.sqlitedb AddressBookImages.sqlitedb-orig
    cd /private/var/mobile/Library/Calendar
    mv Calendar.sqlitedb Calendar.sqlitedb-orig
    3) Respring
    4) From iTunes / Info / (Advanced - bottom of page) --- check the following boxes:
    Replace Information on this Phone
    -- Contacts
    -- Calendar
    5) Sync

    iTunes will rebuild the databases completely from scratch. My database files reduced by 50+% .

    WARNING: If you forget to check Replace Information (Contacts and Calendar check-boxes) on this iPhone , you computer database may get wiped out completely. Take heed !!!!

    Note1: If you don't delete the database on the iPhone, it will not be rebuilt (only sync'd using the computers as the master)--- even if you check the 'Replace Info' boxes.
    Note2: If something goes amiss, you have the original databases saved (-orig). Safety 1st
    Note3: Don't expect any noticeable performance improvement unless your database is greater then 1MB.

    Option #2:
    You could use sqlite3 on your computer to manually ".dump", then reload the database then put back on the iPhone. Works about the same --- I prefer the iTunes method as I assume it is more dependable and reliable.
    Last edited by Mes; 08-12-2009 at 06:01 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts