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

Owncloud migration fails with postgresql #7432

Closed
danielgauss opened this issue Dec 8, 2017 · 17 comments
Closed

Owncloud migration fails with postgresql #7432

danielgauss opened this issue Dec 8, 2017 · 17 comments

Comments

@danielgauss
Copy link

Steps to reproduce

  1. Currently running owncloud 10.0.3/postgresql 9.6.6
  2. Perform manual upgrade via occ with nextcloud 12.0.4

Expected behaviour

Ready-to-run nextcloud installation

Actual behaviour

Upgrade/Migration fails, leaves DB in unusable state.

2017-12-05T19:39:21+00:00 Set log level to debug
2017-12-05T19:39:21+00:00 Repair step: Repair MySQL collation
2017-12-05T19:39:21+00:00 Repair info: Not a mysql database -> nothing to do
2017-12-05T19:39:21+00:00 Repair step: Repair SQLite autoincrement
2017-12-05T19:39:21+00:00 Repair step: Copy data from accounts table when migrating from ownCloud      
2017-12-05T19:39:21+00:00 Repair step: Drop account terms table when migrating from ownCloud
2017-12-05T19:39:21+00:00 Updating database schema
2017-12-05T19:39:22+00:00 Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_filecache ALTER fileid TYPE SERIAL':

SQLSTATE[42704]: Undefined object: 7 ERROR:  type "serial" does not exist
2017-12-05T19:39:22+00:00 Update failed
2017-12-05T19:39:22+00:00 Maintenance mode is kept active
2017-12-05T19:39:22+00:00 Reset log level

Server configuration

Operating system: Gentoo Linux

Web server: Apache2.4.27

Database: Postgresql 9.6.6

PHP version: PHP 5.6.32

Nextcloud version: 12.0.4

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

Where did you install Nextcloud from: shell/occ

List of activated apps:

App list

Enabled:

  • activity: 2.3.6
  • calendar: 1.5.4
  • comments: 0.3.0
  • configreport: 0.1.1
  • contacts: 1.5.3
  • dav: 0.3.0
  • federatedfilesharing: 0.3.1
  • federation: 0.1.0
  • files: 1.5.1
  • files_antivirus: 0.11.2
  • files_external: 0.7.1
  • files_pdfviewer: 0.8.2
  • files_sharing: 0.10.1
  • files_texteditor: 2.2.1
  • files_trashbin: 0.9.1
  • files_versions: 1.3.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 16.0.2
  • gpxedit: 0.0.7
  • gpxpod: 2.2.1
  • market: 0.2.3
  • notifications: 0.3.1
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.1
  • updatenotification: 0.2.1
    Disabled:
  • encryption
  • external
  • tasks
  • theme-example
  • user_external

Are you using encryption: no

@foux
Copy link

foux commented Dec 14, 2017

I've got the same issue

@theBlackDragon
Copy link

Ran into this issue as well. Rolled back to OwnCloud for now.

@bobspct
Copy link

bobspct commented Dec 20, 2017

I've got the same issue

@ghost
Copy link

ghost commented Dec 23, 2017

Me too. :-(

@MorrisJobke
Copy link
Member

@nickvergessen Mind to have a look?

@nickvergessen
Copy link
Member

It's an issue with bigint handling from doctrine on postgres:
#4504 (comment)

We fixed that for 13:
https://github.com/nextcloud/server/pull/6563/files#diff-e624a0e946331a052958be7dac537569

@MorrisJobke MorrisJobke added this to the Nextcloud 13 milestone Jan 4, 2018
@ghost
Copy link

ghost commented Feb 11, 2018

Ok, so now when I try to upgrade from ownCloud 10.0.4 to Nextcloud 13, occ upgrade says:

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

How should I proceed? Wait for ownCloud 11 and try again?

@nsteinmetz
Copy link

nsteinmetz commented Feb 11, 2018

@Haggl just did today a OC 10.0.4 to NC 12 migration and then NC 13 upgrade.

Had to do some query like described here : #4504 (comment)

Also had to do this one for clients synchronisation : #8084

@ghost
Copy link

ghost commented Feb 11, 2018

@nsteinmetz Thank you so much! Worked perfectly. Interestingly I needed to alter only few tables:

alter table oc_filecache alter fileid TYPE int;
alter table oc_properties alter id TYPE int;
alter table oc_activity alter activity_id TYPE int;
alter table oc_activity_mq alter mail_id TYPE int;
alter table oc_share_external alter id TYPE int;

@MorrisJobke
Copy link
Member

Ok, so now when I try to upgrade from ownCloud 10.0.4 to Nextcloud 13, occ upgrade says:

Correct - And upgrade from OC 10 is only possible via Nextcloud 12 and then an upgrade to 13.

@ingwinlu
Copy link

ingwinlu commented Apr 9, 2018

yeah but you can not upgrade to 12 because of the missing table alterations....

@nsteinmetz
Copy link

@ingwinlu you can do them before launching the upgrade ;-)

@ingwinlu
Copy link

ingwinlu commented Apr 9, 2018

You were too fast I just wanted to edit the comment to sound less whiny ;).

What I would have loved to see is a patch to nextcloud 12 to run those changes during the 'normal' update procedure. That way I would not have had to manually figure out my postgres setup again and run those alterations manually.

I now upgraded to 12 successfully as well.

@trifle
Copy link

trifle commented May 2, 2018

Add one migration:
alter table oc_files_trash alter auto_id TYPE int;

@Nowaker
Copy link

Nowaker commented Apr 26, 2020

This is a nonsense. When migrating from owncloud, you have to migrate to nextcloud 12 before bumping to the latest version. At the same time, nextcloud 12 is obsolete and buggy.

@nickvergessen
Copy link
Member

For updating/migrating 12 is still supported. But yeah it's on our list to create a more recent update path. But it's also kind of hard to make sure all edge cases are converted correctly because after nextcloud 12/owncloud 9.2/10 it diverged more and more

@Nowaker
Copy link

Nowaker commented Apr 26, 2020

Maybe it makes more sense to promote v12 as a limited support version, only as a step in upgrade path? E.g. release a new version of 12.999.0 that is guaranteed to work with any PHP version (up to 7.4.x) and always have backports for anything that is needed for a migration to 12 to succeed, and nothing more.

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

10 participants