Skip to content

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

Closed
wants to merge 94 commits into from
Closed

Add profile backup/restore functionality #548

wants to merge 94 commits into from

Conversation

samuel-w
Copy link
Contributor

@samuel-w samuel-w commented Jul 15, 2020

This is mostly complete, I just need to add importing a file generated in an old schema version

For schema version upgrades, there are 2 approaches I could take:

  1. Create new temporary database, upgrade it to current schema, and merge the two

    • Can upgrade easily using code from init_db, difficult to implement initially but requires less maintenance
  2. Modify the dictionary in memory, then save normally

    • 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

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

@m3nu m3nu requested review from m3nu and Hofer-Julian July 15, 2020 07:54
@Hofer-Julian Hofer-Julian reopened this Jul 15, 2020
@Hofer-Julian
Copy link
Collaborator

Sorry about the closed/reopened PR.

I see this PR is still marked as a draft. Is it ready to be reviewed?

@m3nu
Copy link
Contributor

m3nu commented Jul 15, 2020

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.

@samuel-w
Copy link
Contributor Author

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
@samuel-w samuel-w marked this pull request as ready for review July 19, 2020 23:04
@m3nu m3nu added type:task A TODO and removed type:task A TODO labels Aug 10, 2020
It doesn't have defaults set. I should have caught that in review.
@codecov-io
Copy link

codecov-io commented Nov 19, 2020

Codecov Report

Merging #548 (4d2382a) into master (9af1eb5) will increase coverage by 0.40%.
The diff coverage is 81.19%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/vorta/views/misc_tab.py 82.60% <41.66%> (-14.46%) ⬇️
src/vorta/models.py 80.19% <50.00%> (-0.62%) ⬇️
src/vorta/views/main_window.py 83.24% <82.05%> (-1.01%) ⬇️
src/vorta/views/backup_window.py 84.47% <84.47%> (ø)
src/vorta/views/profile_add_edit_dialog.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9af1eb5...4d2382a. Read the comment docs.

@samuel-w
Copy link
Contributor Author

What is preventing this from being merged?

@m3nu m3nu marked this pull request as draft February 15, 2021 01:13
@samuel-w samuel-w marked this pull request as ready for review February 18, 2021 05:24
@samuel-w
Copy link
Contributor Author

samuel-w commented Mar 1, 2021

8 month anniversary! This is probably not going to get merged.

@samuel-w samuel-w closed this Mar 1, 2021
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

Successfully merging this pull request may close these issues.

Make Vorta profiles easy to backup and restore
4 participants