BiT wants to update snapshots; all snapshots gets deleted

Bug #575022 reported by Nikke
24
This bug affects 3 people
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/snapshots.py)
- When starting BiT it calls has_old_snapshots which seems to returns true if there are any snapshots of version 3 (also in common/snapshots.py), and hence triggering the update-procedure
- 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/Desktop/testBiT
INFO: Folder of profile 1 is set to /home/niklas/Desktop/testBiT

Move snapshots from /home/niklas/Desktop/testBiT/backintime to /home/niklas/Desktop/testBiT/backintime
To move: ['20100504-104957-386']
Already there: ['20100504-104957-386']
Snapshots expected: ['20100504-104957-386', '20100504-104957-386']
Command "mv -f "/home/niklas/Desktop/testBiT/backintime/20100504-104957-386" "/home/niklas/Desktop/testBiT/backintime"" returns 256
Remove: 20100504-104957-386
Command "find "/home/niklas/Desktop/testBiT/backintime/20100504-104957-386" -type d -exec chmod u+wx {} \;" returns 0
Command "rm -rfv "/home/niklas/Desktop/testBiT/backintime/20100504-104957-386"" returns 0
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

Revision history for this message
Dave (dave2010) wrote :

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/'''
                if version is None:
                        version = self.get_int_value( 'config.version', 1 )

changing the last line to

                       version = self.get_int_value( 'config.version', self.CONFIG_VERSION )

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

Revision history for this message
Dave (dave2010) wrote :

This appears to fix converting old formats as well

Removed BiT completely (all configs/backups/software)
Installed version 0.9.26
Started GUI, setup profile to backup a small directory
Made a few backups creating new files in test directory in between (stored into /mnt/backups/backintime/20100504...)
Uninstalled BiT (backup directory left)
Installed .9.99.35
Started GUI - prompted to convert, converted ok
Old backup directories moved to /mnt/backups/backintime/mymachine/username/1/xxx
New backups ok

Revision history for this message
Dave (dave2010) wrote :

Just to be clear - in the steps above, after Installing .9.99.35 I edited config.py to change the version= line before running the GUI for the first time.

If I run .9.99.35 without the fix first, then the 2010... directory will be in the wrong place. If I then apply the fix and run the GUI again it appears to get converted ok.

Dan (danleweb)
Changed in backintime:
importance: Undecided → High
status: New → Confirmed
Dan (danleweb)
Changed in backintime:
importance: High → Critical
Revision history for this message
Dan (danleweb) wrote :

FIx commited. Thanks Dave

Changed in backintime:
status: Confirmed → Fix Committed
Dan (danleweb)
Changed in backintime:
status: Fix Committed → Fix Released
Revision history for this message
Wolfram (woppl) wrote :

I am running BiT 1.0.4 on Ubuntu 10.04. First backup seems o.k., but second time it wants to convert to new structure and deletes all backup into trash-folder.

Thought you have released a fix on this...Any suggestion how to solve?
Wolfram

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.