Skip to content

Owncloud migration fails with postgresql #7432

Description

@danielgauss

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

Activity

  1. foux commented on Dec 14, 2017

    @foux

    I've got the same issue

  2. theBlackDragon commented on Dec 15, 2017

    @theBlackDragon

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

  3. bobspct commented on Dec 20, 2017

    @bobspct

    I've got the same issue

  4. MorrisJobke commented on Jan 2, 2018

    @MorrisJobke
    Member

    @nickvergessen Mind to have a look?

  5. nickvergessen commented on Jan 4, 2018

    @nickvergessen
    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

  6. added this to the Nextcloud 13 milestone on Jan 4, 2018
  7. nsteinmetz commented on Feb 11, 2018

    @nsteinmetz

    @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

  8. MorrisJobke commented on Feb 12, 2018

    @MorrisJobke
    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.

  9. ingwinlu commented on Apr 9, 2018

    @ingwinlu

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

  10. nsteinmetz commented on Apr 9, 2018

    @nsteinmetz

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

  11. ingwinlu commented on Apr 9, 2018

    @ingwinlu

    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.

  12. trifle commented on May 2, 2018

    @trifle

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

  13. Nowaker commented on Apr 26, 2020

    @Nowaker

    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.

  14. nickvergessen commented on Apr 26, 2020

    @nickvergessen
    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

  15. Nowaker commented on Apr 26, 2020

    @Nowaker

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions