This is basically the same question as this one , except that I don’t use PhoneGap (so I don’t think of the solutions offered there).
I have pure HTML / JS webapp that works offline (using WebSQL for storage and AppCache for disconnected use).
The application has an “export” option, which serializes the data as JSON and loads it into the AWS S3 bucket for backup; and the corresponding import option for recovery. However, since this is a complete dump / restore of the entire db, the process is not so fast, so I usually do backups on a weekly basis.
As expected, updating OTA from iOS 5 to 5.1 deleted my local webSQL database , but I was able to successfully recover data from S3 (fortunately, I just made a backup before the update).
Unfortunately, after a couple of weeks of working with iOS 5.1, he again decided that he needed a place and deleted my webSQL db . Again, I was fortunate that this happened right after my regular weekly backup; but I’m worried that if this becomes commonplace (iOS removes this “temporary” database to free up space), it will be shortly before I catch you without copying for several days.
I plan to eventually quit the now defunct WebSQL and use IndexedDB; but of course, iOS does not yet support IndexedDB . I also plan to change the export / import process in my application, so that instead of performing a full dump / restore, it simply synchronizes any changed records with S3 (so that the backup to S3 is smaller due to the hassle, and therefore they can be done more often, than weekly).
In the meantime, there are some hacks / workarounds / tricks to ensure that the beta version of WebSQL is not cleared by iOS 5.1 ; or is there any way that I can predict when a cleanup might happen so that I can try to unload it by doing an export to back up my data?
Scott source share