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

nextcloud_version and updating do not work well together #30

Open
4 tasks
nkakouros opened this issue Nov 3, 2019 · 7 comments
Open
4 tasks

nextcloud_version and updating do not work well together #30

nkakouros opened this issue Nov 3, 2019 · 7 comments

Comments

@nkakouros
Copy link
Collaborator

nextcloud_version is used to create the url where Nextcloud will be downloaded from. The role also checks if there is an update available and if there is it re-downloads Nextcloud and re-installs it. The problem is that the url will be for the version defined in nextcloud_version and not the newer version.

TODO

  • Parse the output of updater/updater.phar to get the update url
  • Check if the update concerns the major version defined in nextcloud_update
  • Run the update if so
  • Add a new nextcloud_update: true variable to toggle the update functionality
@simonspa
Copy link
Contributor

There are more issues with the way we currently upgrade:

  • Tiny issue: the updater.phar now asks a question, so we need to pass the --no-interaction flag
  • More conceptual issue: we are not using the upgrader itself but just download and install a new version as far as I understand the code. This means:
    • either we just drop the file son top of the old installation (not so clean), especially as a new instanceId and password salt are generated I guess? Or we would need to copy over the config.php?
    • or we lose all manually installed apps (related to More options for App handling #33 (comment)) which are not in nextcloud_apps.

Is there a reason for not resetting the file permissions, then directly using the upgrader and then setting file permissions properly again?

@nkakouros
Copy link
Collaborator Author

Extracting the files on top of the old ones is a valid option to upgrade Nextcloud. config.php and manually installed apps will not be removed as the nextcloud archive will not overwrite those when extracted.

But, if we implement checks so that the maximum major version to be installed is that specified in nextcloud_version, then I guess there is not much against the automatic update. It does automatic backups and other stuff that are useful.

@simonspa
Copy link
Contributor

I'm being very petty here, but the manual says:

Rename your current Nextcloud directory, for example nextcloud-old.

Unpacking the new archive creates a new nextcloud directory populated with your new server files. Move this directory and its contents to the original location of your old server. For example /var/www/, so that once again you have /var/www/nextcloud.

So they don't extract on top but replace the whole folder

@nkakouros
Copy link
Collaborator Author

You are right, it is cleaner this way. In any case, let's use the occ utility to upgrade. We should have versions checks though so that the user can "lock" the nextcloud major version.

@simonspa
Copy link
Contributor

This is a bit more annoying than I thought:

$ sudo -u www-data php occ upgrade:check
Nextcloud 16.0.6 is available. Get more information /* ... */
Update for files_rightclick to version 0.15.1 is available.
2 updates available

Cool, so we can simply update and end up at the right place (i.e. not jumping versions)? No!

$ sudo -u www-data updater/updater.phar
Nextcloud Updater - version: v16.0.0beta3-4-gc7a4074

Current version is 16.0.0.

Update to Nextcloud 17.0.1 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-17.0.1.zip

@simonspa
Copy link
Contributor

nextcloud/updater#254

@simonspa
Copy link
Contributor

simonspa commented Jun 6, 2020

I will look into proposing a patch to NC to at least get this fixed for future versions.

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

No branches or pull requests

2 participants