Test our new work-in-progress upgrader script


#1

Update: We now ship this in 9.0.54 and 10.0.1 - see Test our new work-in-progress upgrader script - Thanks for testing!


Hi there!

@MorrisJobke and me spend some time to work together on a revamped web updater, the reasoning behind this and what technically happens in the background can be read at https://github.com/nextcloud/updater/issues/2

In a nutshell: Instead of relying on the old ownCloud updater that does stuff like shell_exec (which often is blocked at shared hosting providers and so on), this is a simple script that simply does what it should do: Replace all program files.

We’d utmostly appreciate any testing from YOUR side. It would be great to know whether we missed some test cases.

To test this upload the file from https://raw.githubusercontent.com/nextcloud/updater/add-simplified-updater/index.php to /updater/index.php in your ownCloud or Nextcloud. And add the following to your config file (remove this value later after testing again!):

'updater.server.url' => 'https://updates.nextcloud.org/updater_server/',

Then switch in your admin screen to another channel and back to “stable”. You should also get a message displayed that a newer version is available. (if a warning is displayed that shell_exec is required, take a look at Test our new work-in-progress upgrader script)

The following behaviour would be expected:

  1. If you are on 9.0.50 it should update you to 9.0.51 if you go to /updater/
  2. If you are on ownCloud 9.x or 8.2 it should update you to Nextcloud 9.0.51

You can either access the updater directly at /updater/ (e.g. https://example.com/updater/) or change the channel in your admin screen to “daily”. Reload the page and then press the “Open updater” link.

Any feedback would be welcome! Something broke? Let us know. It worked fine? Let us know as well. :rocket:


Attention: While we have tested the script quite a lot, we’d encourage you to make a backup of your instance before trying it out.


Migrating from ownCloud to Nextcloud
Using updater app to get NC 10 beta or daily
Updater App doesn't find 9.0.52
Proper Updater for NextCloud
Nextcloud 9 update brings security, open source enterprise capabilities and support subscription, iOS app
Problems with code integrity?
Can't connect Nextcloud Android app with the server
OwnCloud to NextCloud Upgrade Considerations
Unable to update from 9.0.51?
How to test NC 10RC1 update with updater app?
Updating NC 9.0.51?
Help testing the 9.0.54RC1 and 10.0.1RC1
New Nextcloud maintenance releases out with improved updater and over 40 fixes
How to test NC 10RC1 update with updater app?
Confusion and problems regarding update
#2

Pinned the topic until Wednesday to get more awareness and attention on this one.


#3

Well, I replaced the index.php file and restarted Apache. I switched to daily channel but there is no link to the updater. I have to admit that I’m on 9.0.51 already.

But if I go to …/updater/ manually I get an authentication error:

To login you need to provide the unhashed value of “updater.secret” in your config file.
If you don’t know that value, you can access this updater directly via the Nextcloud admin screen or generate your own secret:
<some code to generate a password followed by a login field and button>

Is this intended or an error?


#4

That one won’t do anything then. Only 9.0.50 or older gets a message at the moment, we’re working on adding daily support. Will let you know once that is there, possibly even today.

But if I go to …/updater/ manually I get an authentication error:

That is intended, basically you need to create a password manually if you access it directly. If you press the button in the admin settings (which atm you won’t see since for you no update is available) you will be logged-in manually.


#5

Should we still be disabling all third party apps before updating this way, or is it better for testing if we don’t?


#6

Please leave everything enabled. If it fails, let us know what fails :slight_smile:


#7

It worked fine for me going from 9.0.50 to 9.0.51 (Freebsd 9, Apache24, mysql56) leaving everything enabled.
The only thing I find weird is that it asks for the upper dir level of the nextcloud root dir to be writable by the Apache demon. In other words, in my case, I have nextcould installed in path-to-www/nextcloud/… and the updater asks path-to-www to be writable by Apache. Is that the expected behaviour?
Anyway great job!!!


#8

mh I don’t know whether this is a good idea but is it possible to copy all old files to a backup directory so you can rollback the update if something went wrong?


#9

We are actually doing that, the rollback is not yet implemented though. Basically if a step => 7 fails we should rollback. (ref https://github.com/nextcloud/updater/issues/9)

Note however that the backup will NOT include any user data or the database. This would simply be too much. But if a copy step fails it should gracefully fallback.


#10

Hey I did a Fresh install on 9.0.50 and uploaded the index.php to the folder.
If i go into the Update section on the Admin panel there is no update for me, does not matter which Chanel check into. If I go to the updater URL it gives me the following:


#12

Really 9.0.50 or maybe 9.0.51? Normally a fresh install is with the latest version :stuck_out_tongue:


HTTP 503 Error - installation
#13

Should have said. “A fresh install a few days ago, before 9.0.51 was released” :slight_smile:


#14

Could also be caused by some caching as we don’t have enabled the updates officially yet for obvious reasons. You can get around this by adding this to your config file:

'updater.server.url' => 'https://updates.nextcloud.org/updater_server/',

However, there is some more caching in place. So you need to manually change the channels in your admin screen as well then. I’d suggest to switch from stable to beta and back to stable. :slight_smile:

Let me know if that didn’t work! :slight_smile:


#15

@AlfredSK We just added support for different release channels, it requires a little bit more work right now to test since you are on a Nextcloud version that doesn’t do the automatic migration of the channel the config file. But it shouldn’t be hard :wink:

Add the following to your config file:

'updater.release.channel' => 'daily',

And download the newest version of the updater script from https://raw.githubusercontent.com/nextcloud/updater/add-simplified-updater/index.php


#16

This seem to do the trick… however shell_exec is not available for me, does this mean I need to manually do it, or are you working on this too ?


#17

As I understand there is no shell_exec anymore. It’s just copying files to the Application Directory


#18

Hehe. That’s another one, so Nextcloud 9.0.50 and 9.0.51 ship the broken ownCloud updater. To prevent breaking user data it is deactivated in a lot of cases. (if you would have clicked on the button here like you can in ownCloud your instance would get destroyed!)

I just created a revert PR at https://github.com/nextcloud/server/pull/228 for this, for you to test this the easiest way would be to change https://github.com/nextcloud/server/blob/49a916fb46a2281aed818d20a9487b6af7e2b1dc/apps/updatenotification/controller/admincontroller.php#L135 into the following:

‘updaterRequirementsFulfilled’ =>true,

The file for this is apps/updatenotification/controller/admincontroller.php.

That’s correct, unfortunately some things like this check we can’t super easily change. Let’s see what we can do about this to make it as easy as possible for users to update :wink:

Likely it might be an app that can be installed via appstore that ships the corrected code. Also would allow ownCloud users to easily migrate with one click.


Manual installation?
#19

Ok, done this and I could do the update now

if there weren’t this warning :slight_smile:

http://imgur.com/a/xdK2f Album click me

These folders are put into the root of each domain for web statistics reasons.


#20

Yeah. Sadly there is not much here what we can do about this. Our belief is that we don’t want in any case to operate in a case where we could by incident delete user data. That’s something that happened quite often with other updaters.

So the updater will only run in scenarios where we have a very high level assurance that we won’t overwrite user changes. We do recommend users to install Nextcloud in it’s own directory. If that isn’t possible the only thing we can recommend then is a manual update :wink:


#21

Wonderful work, thanks heaps for all your efforts!

A few glitches I noticed:

  • if directory /$NC/data_old is present, the updater stops telling (only) “data_old is present” Why is that: apparently no backup of /data/ is done

  • After the first half of updating the German version carries a spelling mistake: “Nextcloud wird auf Version 9.0.51 aktuallisiert

  • Installation is halted on this page as button “Start Update” does not respond to clicks! :-/