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

Migration from Owncloud 10.0.9 on Ubuntu 18.04.01 LTS fails #11596

Closed
JochenHWezel opened this issue Oct 3, 2018 · 11 comments
Closed

Migration from Owncloud 10.0.9 on Ubuntu 18.04.01 LTS fails #11596

JochenHWezel opened this issue Oct 3, 2018 · 11 comments

Comments

@JochenHWezel
Copy link

JochenHWezel commented Oct 3, 2018

Executed steps with success:
wget https://download.nextcloud.com/server/installer/migrator/index.php
...
https://owncloud.myserver.com/owncloud/updater/index.php
Web-Update part completed, maintenance mode kept active, next step is to run occ upgrade

occ upgrade fails with

root@localhost:/var/www/owncloud# sudo -u www-data /usr/bin/php5.6 occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

I used php5.6 since ubuntu 18.04 doesn't contain php5 any more and nextcloud v12 doesn't support php7.2 which is installed at ubuntu 18.04

This is how I installed php5.6:

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt install php5.6
apt-get install php5.6-mysql php5.6-mcrypt  php5.6-mbstring php5.6-curl php5.6-common php5.6-xml php5.6-json php5.6-intl php5.6-gd php5.6-zip

Expected behaviour

  • migration should work with php 7.2
  • migration should work with php 5.6 at step sudo -u www-data /usr/bin/php5.6 occ upgrade

Actual behaviour

  1. migration not possible with php 7.2 because nextcloud 12 doesn't support php 7.2
  2. migration fails with above error statement

Server configuration

Operating system:
ubuntu 18.04 LTS

Web server:
current apache

Database:
mysql

PHP version:
ubuntu LTS default: php7
manually installed php5.6

Nextcloud version: (see Nextcloud admin page)
12.0.10

Updated from an older Nextcloud/ownCloud or fresh install:
owncloud 10.0.9

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #5155 (Migrations), #7432 (Owncloud migration fails with postgresql), #2203 (Migration from OC 9.1.2 to NC 10.0.1 not possible), #4935 (Migrate from OwnCloud 10), and #8441 (OwnCloud 9.1.7 migration ).

@MorrisJobke
Copy link
Member

Exception: Updates between multiple major versions and downgrades are unsupported.

Could you open the version.php and add there this line to the ownCloud section:

		'10.0.9.5' => true,

Then the migration should start.

@MorrisJobke
Copy link
Member

Fix is in #11601

@JochenHWezel
Copy link
Author

@MorrisJobke fix of version.php worked for starting the upgrade. But now I ran into PHP error:

...
Updating <systemtags> ...
Updated <systemtags> to 1.2.0
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore
...
Checking for update of app twofactor_backupcodes in appstore
Checked for update of app "twofactor_backupcodes" in appstore
Checking for update of app updatenotification in appstore
Checked for update of app "updatenotification" in appstore
Checking for update of app workflowengine in appstore
Checked for update of app "workflowengine" in appstore
PHP Warning:  Unsupported declare 'strict_types' in /var/www/owncloud/apps/support/lib/AppInfo/Application.php on line 2
PHP Parse error:  syntax error, unexpected '?' in /var/www/owncloud/apps/support/lib/Settings/Admin.php on line 94

Another point: direct upgrade possibility with PHP 7.2 (without the requirement to temporary install PHP 5.6) would be great!

@MorrisJobke
Copy link
Member

Ah - so you are on PHP 5.6 and Upgrade directly to 14? This is not possible. You need to upgrade to 12 first and then to the newer versions.

Unfortunately we will not bring PHP 7.2 support for Nextcloud 12.

@JochenHWezel
Copy link
Author

JochenHWezel commented Oct 5, 2018 via email

@MorrisJobke
Copy link
Member

Ideally, I could upgrade directly from ownCloud 10.0.9 to nextcloud 14 using php 7.2

Not possible right now. And also not planned AFAIK.

@JochenHWezel
Copy link
Author

@MorrisJobke Have you got a hint for solving this error (as stated above)?
PHP Warning: Unsupported declare 'strict_types' in /var/www/owncloud/apps/support/lib/AppInfo/Application.php on line 2
PHP Parse error: syntax error, unexpected '?' in /var/www/owncloud/apps/support/lib/Settings/Admin.php on line 94

@MorrisJobke
Copy link
Member

@MorrisJobke Have you got a hint for solving this error (as stated above)?
PHP Warning: Unsupported declare 'strict_types' in

This is because of running PHP 7.0+ code (looks like Nextcloud 14) on PHP 5.6, which is not supported.

So you have an ownCloud 10.0.9 running on PHP 7.2 right? I guess we are missing this as a migration path. We only support the upgrade from PHP 5.6-7.1 to Nextcloud.

cc @nickvergessen

@MorrisJobke MorrisJobke reopened this Oct 8, 2018
@MorrisJobke
Copy link
Member

@JochenHWezel I just thought a bit more about this and this is the way you need to go

  • current: ownCloud on PHP 5.6
  • next step: migrate to Nextcloud 12.0.x on PHP 5.6
  • next step: upgrade to Nextcloud 13 on PHP 5.6
  • next step: upgrade PHP to 7.2 (native one on Ubuntu 18.04) - Nextcloud 13 is the first release with PHP 7.2 support
  • next step: upgrade to Nextcloud 14 on PHP 7.2 - Nextcloud 14 does not support PHP 5.6 anymore thus you need to upgrade PHP first

This then should work.

cc @tflidd @rakekniven as a hint for questions like this in the forums.

@JochenHWezel
Copy link
Author

JochenHWezel commented Nov 23, 2018

Migration from Owncloud 10.0.10 to NextCloud v12 with Ubuntu 18.04

ToDos

I finally was able to do the migration successful from 10.0.10 to Nextcloud v12 using these commands/points

  1. sudo -s
  2. sudo add-apt-repository -y ppa:ondrej/php
  3. sudo apt update
  4. sudo apt install php5.6
  5. apt-get install php5.6-mysql php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-common php5.6-xml php5.6-json php5.6-intl php5.6-gd php5.6-zip
  6. cd /var/www/owncloud/
  7. rmdir assets
  8. rmdir etc
  9. chown -R www-data:www-data *
  10. chown -R www-data:www-data .
  11. cd updater
  12. rm index.php
  13. wget https://download.nextcloud.com/server/installer/migrator/index.php
  14. Open webbrowser and start updater as described at
  15. When updater was successful, it asks for continueing with 2nd step either by web or by console. Select the console process
  16. sudo -u www-data /usr/bin/php5.6 occ upgrade

Results

  1. Note: maintenance mode is still activated
  2. Your new nextcloud website shows up with an error message This version of Nextcloud is not compatible with > PHP 7.2. You are currently running 7.2.10-0ubuntu0.18.04.1.
  3. PHP 5.6 has been installed temporary on the system
  4. The nextcloud directory is now owned and writable by the www-data user (sometimes instead of root user which was the owner when owncloud was installed via apt-get)

I think this is okay so far, because you'll continue with update to v13.

Update from Nextcloud v12 to Nextcloud v13

  1. cd /var/www/owncloud/updater
  2. sudo -u www-data php updater.phar
  3. Keep the maitenance mode active to continue with update to Nextcloud v14
  4. Check your nextcloud server shows the maintenance page of nextcloud successfully - this should be possible now again because Nextcloud is compatible with PHP 7.2 which is in use by Ubuntu 18.04
  5. Remove the temporary PHP 5.6 installation again
    1. apt-get remove php5.6-mysql php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-common php5.6-xml php5.6-json php5.6-intl php5.6-gd php5.6-zip
    2. sudo apt remove php5.6
    3. sudo add-apt-repository -y --remove ppa:ondrej/php
    4. sudo apt update

Update from Nextcloud v13 to Nextcloud v14

  1. cd /var/www/owncloud/updater
  2. sudo -u www-data php updater.phar
  3. When asked, run the occ upgrade again
  4. When asked, switch off the maintenance mode
  5. cd /var/www/owncloud
  6. sudo -u www-data ./occ db:add-missing-indices

Now you can login again with your brand new Nextcloud v14 and with all your previous users and data :-)

Final notes

  1. For compatibility with your end user setup configurations, you might consider adding a symbolic link at your webserver from /nextcloud to /owncloud, but you might want to keep the /owncloud directory as it is (otherwise all users would loose their configured end point as a working URL)
  2. You might want to upgrade the several apps at https://your.nextcloud.server/owncloud/index.php/settings/apps
  3. You might want to download and activate the several nextcloud packages at https://your.nextcloud.server/owncloud/index.php/settings/apps/app-bundles
  4. Check for note by the code integrity advisor, usually at https://your.nextcloud.server/owncloud/index.php/settings/admin/overview#security-warning

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

No branches or pull requests

3 participants