Closed Bug 438369 Opened 14 years ago Closed 11 years ago

Create database backup before performing a database upgrade


(Calendar :: Provider: Local Storage, enhancement)

Not set


(Not tracked)



(Reporter: ssitter, Assigned: Fallen)



(Whiteboard: [not needed beta][no l10n impact])


(1 file)

Sunbird should create a backup of the calendar database before performing a database upgrade. If something goes wrong during the upgrade the backup can be restored (either manually or automatically).
I don't agree, seeing how much trouble there has been with broken profiles after updates we should have a backup for the calendar-data. This especially as system-restore on windows will lose it's function when bug 328603 has landed.
I meant to say I don't agree with Daniels post in the NG, we should have backups, even for nightly builds.
Blocks: 328603
No longer blocks: 328603
mozIStorageService has a method called backupDatabaseFile which can be used here.
OS: Windows XP → All
Hardware: x86 → All
I think we should make use of this. While Daniel is right, we should make sure our provider upgrades with transactions, often users want to try out a new version and then decide to downgrade, because their addons are not compatible. Right now we have to tell them, they need to export their data, then import back to an older profile. Telling them to just replace the database file would be quite nice.

Since our performance with large calendars isn't that good right now its not much of an issue, but we should keep in mind, that if the user has a large calendar and keeps his profile for a few versions, then his profile folder might get quite large. I guess we could keep only the last version, but otoh hard drive space is cheap, so maybe its a non-issue.
Flags: blocking-calendar1.0+
Whiteboard: [not needed beta][no l10n impact]
Attached patch Fix - v1Splinter Review
This patch takes care. I tested this on linux and it didn't cause any problems, I hope that the backupDatabaseFile() method handles locked files gracefully.
Assignee: nobody → philipp
Attachment #547957 - Flags: review?(mschroeder)
Whiteboard: [not needed beta][no l10n impact] → [not needed beta][no l10n impact][needs review]
Duplicate of this bug: 576228
Comment on attachment 547957 [details] [diff] [review]
Fix - v1

Looks good code-wise. r=mschroeder
Attachment #547957 - Flags: review?(mschroeder) → review+
Whiteboard: [not needed beta][no l10n impact][needs review] → [not needed beta][no l10n impact]
Pushed to comm-central <>

Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Trunk
This bug was also pushed to comm-beta and comm-aurora, likely during the last merge.
Target Milestone: Trunk → 1.0b6
You need to log in before you can comment on or make changes to this bug.