Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Restore #47

Closed
solarkraft opened this issue Sep 17, 2021 · 4 comments
Closed

Restore #47

solarkraft opened this issue Sep 17, 2021 · 4 comments

Comments

@solarkraft
Copy link

Hey, I love this tool and how simple, fast and easy it is. I would love to include it in my Dokuwiki distribution.

To provide a complete user experience, however, there (in my opinion) needs to be a way to restore from a backup from inside the web UI.

How hard would this be to build? Would you be willing to do it?

@solarkraft
Copy link
Author

solarkraft commented Sep 17, 2021

Sorry, I didn't search through old issues before creating this one, so I didn't see #42.

I don't think the situations you list are significant issues (am I missing something?) at all since it normally would work and the user could always resort to restoring manually in case it does not, but will have to respect your decision not to work on it.

Would you merge a PR for the functionality?

@tatewake
Copy link
Owner

Hi @solarkraft ,

Feel free to bundle the plugin with your pre-installed instance, I'm okay with that.

However, I think I'll pass on having a "restore" option in this plugin. (My reasoning in the next comment, if you're interested.)

If you still want the feature, I'd recommend creating a "Restore" plugin (perhaps just for your users, since you know what their configuration would be, and you could bundle it inside of your distribution.)

@tatewake
Copy link
Owner

tatewake commented Sep 20, 2021

My reasoning for not including a "restore" option at this point…

The plugin initially had "restore" support either initially (when I released it in 2006) or shortly afterward. Some users were having problems, mostly stemming from incorrect folder permissions, but there would also be non-standard DokuWiki configurations that wouldn't work for one reason or another (I've long forgotten exactly why, but it had to do with non-standard directory locations), and even a few users had "limited file storage" on their university or hosted shell accounts… which weren't a problem of the plugin, but were simple errors users could see if they were to restore manually via shell, but hard to write code to show every possible scenario.

Initially, the plugin used exec to run tar and bzip2 directly via command-line, as it's very flexible to be able to create and extract archives through different switches, and very reliable. But on some systems and configurations, either tar / bzip2 or exec aren't available to run, (and generally it's dangerous to use exec directly anyway), so eventually the plugin moved to using Pear PHP Archive_Tar. This was a great rewrite, until the community discovered a bug that was corrupting the output tar file if it was too big. So I couldn't really trust it to do restoration if it couldn't do archiving correctly. (Again this is years ago, and the bugs in that library are probably fixed by now.)

Since then we've switched to using DokuWiki's internal Tar library, and things are much better now. I didn't do the migration (it was a community contribution) and I haven't thought to revisit it since to add back restoration. I'm not super active in the DokuWiki community all these years later (though I do still support the various plugins, and have done some upgrades here and there), and users generally seem happy with how things are as-is (and that restoring data is something you have to do manually.)

With regards to automatically restoring archives, I think there's still some problems you might run into… again handling non-standard directory locations, whether a user wants to do a "partial restore" of just a few folders, or to wipe everything out and truly "restore" the archive, and trying to think of and handle any errors that might show up, and properly report them. Of course it's possible to do all of this, but I think this is a huge task to try to accomplish correctly.

But like I said in my previous comment, I think it would be worthwhile to make as a separate "restore" plugin if you're up for it.

@solarkraft
Copy link
Author

Thanks for the elaborate answer! I'm probably not going to work on a restore plugin anytime soon, as it's not that high on my list of priorities. For now I will just use a script.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants