-
Notifications
You must be signed in to change notification settings - Fork 33
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
Cleanup remains from previous installations after upgrade #377
Comments
Can you elaborate on how you're updating your instance? If I'm understanding the problem you're attempting to fix (a bunch of extra files being around after doing an update), this shouldn't happen. Are you using the Web or command line Updater? Or a manual update perhaps? |
Hey, I have a FreeBSD jail that has a nextcloud mount where previously installed files will get overwritten upon installation of a new version. This causes the residual files, since I use nullfs mounts (bind in linux terms) for the I could just delete all files there, but in my experience there are files that are part of the configuration and extra installed modules, despite having specified Does this help? |
I'm using the FreeBSD ports package: https://www.freshports.org/www/nextcloud |
Okay so this has nothing to do with our Updater. :-)
You can find hints about the folders/files to retain by reviewing our manual updating process in the Maintenance section of the Admin Manual (https://docs.nextcloud.com). That might help since there sort of what you're doing it sounds like. It's basically I'm going to close this issue out here since there isn't anything actionable for us to do in this end. |
You meant this URL, right? https://docs.nextcloud.com/server/latest/admin_manual/maintenance/manual_upgrade.html |
Correct. |
The methods outlined there might be useful if you only care about the 'main installation' files, that is no 3rd part applications. My script also takes care the extra files of those, in case their automatic update would leave residual files. The only thing that makes me wonder is, sometimes more runs are necessary to entirely clean up extraneous files, so the output of the integritycheck doesn't emit all files every time, seemingly. |
Step 10 covers custom app folders in the manual process.
The Updater takes doesn't leave extra files around unless there's a bug. There is a known issue, which seems more common in FreeBSD environments that impacts the file/folder iterator. It seems particularly easy to trigger with FreeBSD + NFS. There may be some progress on that soon (#158). Keep in mind we don't officially support FreeBSD and the manual update approach is always an option regardless.
It should/ does unless something weird is going on. Technically we use a similar iterator in the integrity checker so it's quite possible if impacted by the previously mentioned issue that it would impact that as well in your environment. |
I was thinking on actually putting together a non-bash-script based cleanup script, that is, native PHP, but I didn't make enough effort to find and extract the code that lists the extraneous files in the codebase. Now with this information on the updater, I have a hint as to where to look for it. :) I might put together something 'more native' in the future for this. |
Yeah, I have read it, but it only says to move folders from the old installation to the new. Which is fine, but still doesn't remove the extra files in there, that I get, unfortunately. |
Hello,
after having found no previously built solution to my problem, and no one answering to my question regarding this on irc, I've built a script that will delete files belonging to a previous, recently upgraded installation of nextcloud after an upgrade. The issue is, files health check (self-check) will fail if you have a recently upgraded nextcloud, and those files are not deleted automatically.
Requirements are:
jq
, a command line json parser.This script is built for my FreeBSD install, so you might want to modify paths within for your installation.
Also, this script won't exit with an error code in case a file is not found (and mentioned as superfluous) but will print it, so you have to check the output, instead of the exit code. A little update for using exit code might be an improvement, I can live with this version as is.
Here's the script, do what you want with it. It can be a good starting point for something similar in the future.
The text was updated successfully, but these errors were encountered: