Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BiT wants to update snapshots; all snapshots gets deleted #1

Closed
Germar opened this issue Oct 11, 2015 · 5 comments
Closed

BiT wants to update snapshots; all snapshots gets deleted #1

Germar opened this issue Oct 11, 2015 · 5 comments

Comments

@Germar
Copy link
Member

Germar commented Oct 11, 2015

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


Imported from Launchpad using lp2gh.

@Germar
Copy link
Member Author

Germar commented Oct 11, 2015

(by dave2010)
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

@Germar
Copy link
Member Author

Germar commented Oct 11, 2015

(by dave2010)
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

@Germar
Copy link
Member Author

Germar commented Oct 11, 2015

(by dave2010)
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.

@Germar
Copy link
Member Author

Germar commented Oct 11, 2015

(by danleweb)
FIx commited. Thanks Dave

@Germar
Copy link
Member Author

Germar commented Oct 11, 2015

(by woppl)
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

@Germar Germar closed this as completed Oct 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant