BiT wants to update snapshots; all snapshots gets deleted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Back In Time |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Hi
I'm running BiT 0.9.99.35~karmic from the launchpad testing PPA under lucid.
Each time I start BiT it says that the backup format has changed and that BiT needs to move my snapshots accordingly - even snapshots taken with this version (configured from scratch). If I choose not to, I cannot take any snapshots. If I choose to move the snapshots, BiT deletes my entire snapshot folder!
Analysing the problem, this is what I've found:
- When taking a snapshot, BiT sets the version of the snapshot to 3 (controlled by the constant SNAPSHOT_VERSION in common/
- When starting BiT it calls has_old_snapshots which seems to returns true if there are any snapshots of version 3 (also in common/
- During the update procedure it seems that BiT first moves the old snapshots to a new folder. However, the old and new folders are the same. Then BiT deletes the old folder - and as new and old folders are the same, the result is that the entire backup structure is deleted!
This is the console output when running backintime-gnome from the terminal:
Back In Time
Version: 0.9.99.35
Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime-gnome --license' for details.
INFO: Snapshot location update flag detected
WARNING: Snapshot location needs update
INFO: Update snapshot locations
INFO: Only 1 profile found
Check snapshot folder: /home/niklas/
INFO: Folder of profile 1 is set to /home/niklas/
Move snapshots from /home/niklas/
To move: ['20100504-
Already there: ['20100504-
Snapshots expected: ['20100504-
Command "mv -f "/home/
Remove: 20100504-104957-386
Command "find "/home/
Command "rm -rfv "/home/
Succes!
INFO: Update was successful. Snapshots of profile 1 are moved to their new location
INFO: BackinTime will be able to make new snapshots again!
[this is preceeded by a long list of all the files BiT removed as part of the update - i.e all the backed up files]
Hope this helps
/N
Changed in backintime: | |
importance: | Undecided → High |
status: | New → Confirmed |
Changed in backintime: | |
importance: | High → Critical |
Changed in backintime: | |
status: | Fix Committed → Fix Released |
After some checking of the code - mainly for bug 572117 (the two bugs seem related but may not be duplicates):
In common/config.py:
def get_snapshots_ full_path( self, profile_id = None, version = None ):
'''Returns the full path for the snapshots: .../backintime/ machine/ user/profile_ id/'''
version = self.get_int_value( 'config.version', 1 )
if version is None:
changing the last line to
allows me to successfully do a second backup from a fresh install. This doesn't necessarily help convert old backup formats to the new directory structure as I haven't tested that.
This does seem to fix doing a fresh install of 0.9.99.35 (or 32), doing a backup, and then running a second backup. With "1" BiT won't do the second backup because it thinks the config.version is 1 instead of 5 (CONFIG_VERSION) and gives the old version 1 style path of .../backintime/ 20100504. .. instead of the new version 5 style .../backintime/ mymachine/ username/ 3/20100504. ..
This doesn't handle converting from old formats