-
Notifications
You must be signed in to change notification settings - Fork 157
Add profile backup/restore functionality #548
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
Conversation
Sorry about the closed/reopened PR. I see this PR is still marked as a draft. Is it ready to be reviewed? |
I'll go first. But we'll need some discussion on the way, since it's a complicated feature. |
I left it as draft so I can get opinions on the approach for schema version upgrades. Currently, it only works when the local schema version is the same as the file version. I think I'll take approach 1, as merging databases doesn't seem easy, and 2/3s of the schema upgrades so far are column additions which seem to be automatically set to default values when using dict_to_model. |
Initial backup work Add backup and restore functionality Use toolbutton for menu Close backup window after saving Lint Seperate out different non profile-based models Update repoSelector when repo added Fix crash when restoring profile while not on repo tab Refresh overwritten tabs Fix profile add button Prevent repo id collisions, update checkboxes on misc overwrite Update tabs only if changed Spelling Ensure archivemodel ids are unique Add skeleton code for schema upgrades
Fixed by changing QDialogBox into two seperate buttons Also added optiion to select all files
Handles when file is json but not Vorta backup json
It doesn't have defaults set. I should have caught that in review.
…s profile selector
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
==========================================
+ Coverage 73.52% 73.93% +0.40%
==========================================
Files 53 54 +1
Lines 3509 3721 +212
==========================================
+ Hits 2580 2751 +171
- Misses 929 970 +41
Continue to review full report at Codecov.
|
What is preventing this from being merged? |
Prevents tests from breaking
8 month anniversary! This is probably not going to get merged. |
This is mostly complete, I just need to add importing a file generated in an old schema version-
- Can upgrade easily using code from init_db, difficult to implement initially but requires less maintenance
-
- Requires writing new upgrading code twice, easier to implement initially but reduces code quality and needs more maintenance
- Changes are only needed for column deletion and in place data changes, column addition can use default values
For schema version upgrades, there are 2 approaches I could take:
Create new temporary database, upgrade it to current schema, and merge the two
Modify the dictionary in memory, then save normally
I don't want to exclude options in between schema versions, as it will be confusing when part of the profile is imported and part is not.
The only way to do schema upgrades is the second way, since dict_to_model will not work with unknown entries.
Also I need to know if WifiSettingModel backup/restore works.
Fixes #462
Discussion #834