View Single Post
Old 07-26-2014, 10:50 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,352
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kaufman View Post
To me, this makes the most sense for backing up settings. People can always transfer their books again. If it was an older version of the backup, you could just apply the settings that still exist and ignore the other ones.
The one counter argument I can make is that the user might not remember what books were on the device. If the database were restored then the books would be listed in calibre on the next connect. The user could select them all and send them. If I ever do the "auto-send changed book" feature then this would become automatic. Connect and the books arrive.
Quote:
I wasn't thinking of the backup as strict copy of the internal data structures, but as a set of preference pairs that you could reapply as the file was loaded. I used an app once that generated this in text as an email that could be copy/pasted into the app later. Then the app parsed the text and reset the settings.
I would rather not have a pick & choose scheme. Lots of settings are related to each other in non-obvious ways.

Attaching the backup to an email message is an interesting idea. I was assuming that the user would put the file into dropbox or drive or what-have-you. CC would create the file wherever the user wants, then the user would use the cloud storage app of choice to get the backup off the phone.
Quote:
Having said all this, if you wanted to backup the book database too, I wouldn't mind. Although, then you would also have to backup the books for people who keep them on internal storage.
I am not totally convinced for the reasons mentioned above.
Quote:
It seems to me that there are two use-cases for this.

1) I lost my device
2) I am upgrading my device.
There are at least two more:
3) I am adding another device while keeping the original (cloning my device).
4) I needed to uninstall CC for some reason and want to restore it.

Quote:
If you are only doing this to support usecase 2, you can just insist that the user upgraded to the current version before starting the migration. For people with books on an external SD card the work would be:

1) Make sure CC is up to date on old device.
2) backup settings and book db to SD card
3) Move SD card to new device
4) Install CC on new device
5) Load settings and book database
This would also work in my additional use case 4, with the assumption that the books are still in main memory.

Hmmm... I am not sure what happens if I install an SD card on a new machine when an app is using the private SD card app folder. Does the app adopt what is there? Does Android clear it first? My guess is that the folder is adopted or things would go bad very fast every time I swapped cards, but given that the kitcat changes make very little sense (to me) I don't trust my intuition.
Quote:
For people without an SD card, I am not sure what the easiest way to do 2 and 5 would be. Plus you would also have to backup and restore the books for them.
Send the backup to the cloud. As for books, again same as above. Or send the books to the cloud as well.

One scheme would be to store the settings and DB backup in the Calibre_Companion folder and use Dropsync (or something like it) to upload that folder to Dropbox whenever a backup is made. That makes a self-consistent set of data.
Quote:
For usecase 1, the settings book db and books would need to be stored off device to be of any use, and since (except for the settings) they are already in calibre, would anyone really do that?
This is a good question. I have already discussed one reason why having the CC database might be a good thing even when I don't have the books. However, it is a very good question whether or not people will understand that backing up the database does not back up the books. Saying that *only* settings are backed up eliminates that possible misunderstanding.
Quote:
I think I am back to my first position. Just backup and restore settings. Its small enough to move around, and gives most of the value that people might be looking for.
Thanks for the comments.

A question related to backing up the db: should the calibre device ID also be backed up? If you are cloning a device or restoring after uninstall/wipe then restoring the device ID would prevent uploading all the metadata on the first connect after restore. However, if you are copying a device then restoring the device ID would be a bad idea because calibre would not be able to distinguish between them. It is very likely that metadata caching would break.
chaley is offline   Reply With Quote