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

electron app auto update performs a backup after download #6005

Merged
merged 4 commits into from
Jun 15, 2023

Conversation

jackkav
Copy link
Contributor

@jackkav jackkav commented May 31, 2023

Motivation:
In order to mitigate the risk of data loss.

Rationale:
We evaluated the trade offs of a full db backup and restore process against exporting each project. We found the restore process to be higher quality and simpler UX to use the existing export feature but trigger it before app updates.

Implementation notes:

  • creates a folder in the current insomnia datapath: /backups/
  • creates another version folder inside of backups: /2023.2.2/
  • when an auto update is triggered and the download is complete, an export file will be created for every project in the database

Restore instructions:

  • In the toolbar click Help then Show App Data folder, open backup folder and select the version folder and all project exports can be found inside and imported through the insomnia import feature.

Future work:

  • add support for project import to the new import mechanism
  • perhaps a backup cleaning process of some kind

Notes:
The auto backup approach is triggered by the electron app auto upgrader functionality, which supports mac and windows, but not the portable binary on windows or linux, in those environments users can navigate to preferences -> data -> export -> export all, for each project they would like to backup.
Auto backup also incurs some necessary disk space usage, this is kept under control by including the version name in the folder, to ensure only the minimum number of necessary backups are made.

closes INS-2659

changelog(Improvements): Will export all projects to app data directory backups folder when auto update download completes

@jackkav jackkav requested a review from a team May 31, 2023 12:30
@jackkav jackkav marked this pull request as ready for review May 31, 2023 14:37
@jackkav jackkav self-assigned this Jun 1, 2023
@jackkav jackkav changed the title backup database backup and restore database Jun 1, 2023
Copy link
Member

@filfreire filfreire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We don't restore past responses, but I reckon this is far better than not being able to restore request data. I say - ship it
image

@jackkav jackkav changed the title backup and restore database export projects before app upgrade Jun 13, 2023
@jackkav jackkav changed the title export projects before app upgrade electron app auto update performs a backup after download Jun 15, 2023
@jackkav jackkav added this pull request to the merge queue Jun 15, 2023
Merged via the queue into Kong:develop with commit 63754de Jun 15, 2023
@jackkav jackkav deleted the feat/db-backups branch June 15, 2023 12:32
@gatzjames
Copy link
Contributor

Awesome 👏

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.

3 participants