Kup icon indicating copy to clipboard operation
Kup copied to clipboard

Automatically offer option to restore backup, and restore backup plan.

Open Uatschitchun opened this issue 5 years ago • 12 comments

In case one wants to restore a backup on a new machine, after installing kup, how do you get to restore a backup?

I see kup-filedigger on CLI, but no way to start it from GUI!?

What is the way2go for to restore after maybe a fresh OS install and kup being enabled?

Is there a way to save backup-plans and restore these, too?

It would be beautiful, if kup would automagically detect Backups on a medium, if told to. Maybe even also import back backup-plans ;)

Uatschitchun avatar Jul 23 '18 13:07 Uatschitchun

Thanks for the good suggestions!

You are right that it is not so good as it is now. I did spent quite a lot of time and effort on making the filedigger app, just so that it would be a nicer experience to restore stuff. But launching it is a bit inconvenient, need to do it from command line with the path of the backup as argument.

With kup I have been careful to avoid scanning filesystem in the background unneccesarily, I don't want to slow down the user's system.

I do like your idea of detecting a medium with backups on it. Perhaps it could be an idea to just store a hidden file in the root. That file could contain the details of the backup plans stored on that medium. That would allow offering a restore automatically. And without scanning the whole disk looking for backups.

spersson avatar Jul 29 '18 12:07 spersson

So after thinking some more about this, here is my conclusion for now: The idea of popping up a notification on a newly installed OS, saying "Backups detected, do you want to restore?" seemed very tempting at first. But it means I would need to run a background program the whole time, on every system regardless if the use kup or not... just that they have it installed would be enough. I don't like that. But even more.. the risk of showing that question unnecessarily on a day to day basis is very bad (would be super annoying to the user) or opposite: the risk then of trying so hard to not show the question unnecessarily that we miss the chance to show it when that day actually comes... making the whole effort wasted. So I decided against offering such a question. Regardless of that.. there would still be a need to launch filedigger manually. I first had tried to avoid adding a launcher to the system meny, just to not fill up the meny with applications that you very very seldom need to run. But you are right, it seems there is no way to avoid it. The only other option would be for a user to "somehow" restore the kuprc files into ~/.config/ and then after a restart kup-daemon will run and the system tray plasmoid is available, will detect the precence of a backup destination and offer to restore from there. But that "somehow" is critical... how can you expect that a user who has a newly installed OS will know to recover just that file manually in some way. You can't. So a filedigger launcher from the meny seems like the only solution. And I think that is enough to settle this issue. Please comment you have any thoughts on this! Thanks again for reporting!

spersson avatar Sep 04 '18 02:09 spersson

After reading, I made up my mind, too ;) Especially as I did install a new system on a new Laptop. An idea would be, after first installation of kup, to have an option in the backup plan utility to search for backups and previous plans to restore from. This way, after a new installation (one point in time when a backup comes to play), the user is a) able to restore an existing backup (looking for media containing backups and start filedigger from backup-plan), is b) able to restore previous plan (kuprc) in a defined way and c) is able to re-use previous plans. So with being able to start filedigger (restore) from backup-plan, there wouldn't be a need for having filedigger as an entry in system-menu, as all is in one place. A possibility to start backup-plan from plasmoid would be nice, too ;)

Uatschitchun avatar Sep 06 '18 12:09 Uatschitchun

You're onto something there. It could be an idea to offer restore operations from the system settings module in case the kuprc is missing. I'll think some more about that.

spersson avatar Sep 08 '18 08:09 spersson

Nice ;)

Uatschitchun avatar Sep 26 '18 11:09 Uatschitchun

So now you can launch restore from system settings instead of start menu. Still keeping this issue open to remind myself that it could still be an idea to store a small hidden file in root of external drive with info about backups stored on that drive. Then from kcm instead of just launching filedigger and letting user navigate to backups, search connected drives for backups and launch filedigger for any repo found.

spersson avatar Dec 31 '18 04:12 spersson

I'll check

Uatschitchun avatar Jan 02 '19 13:01 Uatschitchun

If Kup were a part of KDE Plasma, we could have one of its many existing daemons perform the detection and notification. :)

See also https://github.com/spersson/Kup/issues/76

Another idea is to make the Calamares installer Kup-aware and offer to restore from backup during the initial installation. This would probably be an easier sell if Kup were integrated into Plasma itself and therefore available by default for everyone.

Pointedstick avatar May 26 '19 22:05 Pointedstick

@Pointedstick Interesting issue this one, every time I visit it I think more of what could be done and how. There is clearly potential to do more/better than current solution. Today my thoughts are:

  1. Perhaps the Plasma device notifier could be improved so that it can offer an action item based on the existance of a file on the device. Then installing kup could install such an action item, user could simply select a "Restore Files" option from notifier applet after plugging in drive. Downside is that this is perhaps too hidden, the one time when you actually need it you didn't think to look there. Active popup could be better.
  2. Add KDED module, but again... like in my comment above on sept 4, how to reliably detect that files are missing and user probably want to restore? Is it enough to just check if the kuprc file is missing? Hmm. Possibly. I really don't want to popup a question at the wrong time.

No conclusion for now. :)

spersson avatar May 29 '19 08:05 spersson

@Pointedstick Oh and about offering restore from an installer... That was an interesting idea! So cool when people drop by and plant things in my head I would never have thought of otherwise. But my first reaction is that you would have to have a step in the installer that asks the user "If you have a disk with backups on it, plug it in now. Otherwise click the skip button." Seems a bit much to ask for. But very cool idea. :)

spersson avatar May 29 '19 09:05 spersson

But my first reaction is that you would have to have a step in the installer that asks the user "If you have a disk with backups on it, plug it in now. Otherwise click the skip button." Seems a bit much to ask for. But very cool idea. :)

In fact that's exactly what the macOS installer has done for about 10 years now. It's an incredibly great user experience IMO. True, it is indeed an extra step, but if you have a backup disk (and Mac users are quite likely to have one since the Mac Time Machine system is so good) then it's something you're going to really appreciate.

Pointedstick avatar May 29 '19 15:05 Pointedstick

@Pointedstick Interesting issue this one, every time I visit it I think more of what could be done and how. There is clearly potential to do more/better than current solution. Today my thoughts are:

1. Perhaps the Plasma device notifier could be improved so that it can offer an action item based on the existance of a file on the device. Then installing kup could install such an action item, user could simply select a "Restore Files" option from notifier applet after plugging in drive. Downside is that this is perhaps too hidden, the one time when you actually need it you didn't think to look there. Active popup could be better.

The Devices Notifier does indeed pop up when you plug in a disk, and it even offers actions you can perform on it. I think it would probably be pretty simple to draft a desktop file that offers "Restore files" or something when it sees the special hidden file. See for example https://cgit.kde.org/kio-extras.git/tree/mtp/solid_mtp.desktop

Pointedstick avatar May 29 '19 15:05 Pointedstick