server icon indicating copy to clipboard operation
server copied to clipboard

Error while migrating from Owncloud 10.3.x to Nextcloud 12.0.13

Open boschma1 opened this issue 7 years ago • 3 comments

I wanted to upgrade from OC 10.3 to NC 12.0.13 and thought this would be a piece of cake. However, I am now stuck. I followed the bumpy installation described here: https://help.nextcloud.com/t/failed-update-oc-10-3-to-nc-12-0-13/64313. I received this error message when running the ./occ upgrade command:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_filecache CHANGE fileid fileid INT AUTO_INCREMENT NOT NULL, CHANGE parent parent INT DEFAULT 0 NOT NULL, CHANGE mtime mtime INT DEFAULT 0 NOT NULL, CHANGE storage_mtime storage_mtime INT DEFAULT 0 NOT NULL':

SQLSTATE[HY000]: General error: 3780 Referencing column 'file_id' and referenced column 'fileid' in foreign key constraint 'FK_F0C3D55B93CB796C' are incompatible. Update failed

This doesn't look good to me at all. Do you have any idea to fix this? Thank you.

Steps to reproduce

  1. follow https://help.nextcloud.com/t/failed-update-oc-10-3-to-nc-12-0-13/64313

Expected behaviour

The migration should go well and this should be way easier to migrate from OC to NC as shown on your website and your videos!

Actual behaviour

Update failed

Server configuration

Azure VM

Operating system: Ubuntu 19.10

Web server: Apache2 Database: MySQL

PHP version: PHP 7.1/7.2/7.3

Nextcloud version: (see Nextcloud admin page) 12.0.13

Updated from an older Nextcloud/ownCloud or fresh install: OC 10.3.1

Where did you install Nextcloud from: Web

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Enabled:
  - comments: 0.3.0
  - dav: 0.5.0
  - federatedfilesharing: 0.5.0
  - files: 1.5.2
  - files_external: 0.7.1
  - files_pdfviewer: 0.11.0
  - files_sharing: 0.12.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - firstrunwizard: 1.2.0
  - lookup_server_connector: true
  - notifications: 0.5.0
  - oauth2: true
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - twofactor_backupcodes: true
  - updatenotification: 0.2.1
  - workflowengine: true
Disabled:
  - activity
  - admin_audit
  - encryption
  - federation
  - files_texteditor
  - files_videoplayer
  - gallery
  - logreader
  - nextcloud_announcements
  - password_policy
  - serverinfo
  - sharebymail
  - survey_client
  - theming
  - user_external
  - user_ldap

**Nextcloud configuration:**
<details>
<summary>Config report</summary>

If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder { "system": { "instanceid": "ocb1130ebee9", "passwordsalt": "REMOVED SENSITIVE VALUE", "trusted_domains": [ "owncloud.loomion.com" ], "datadirectory": "/owncloud_data", "overwrite.cli.url": "https://owncloud.loomion.com", "dbtype": "mysql", "version": "10.3.1.1", "dbname": "owncloud", "dbhost": "127.0.0.1", "dbtableprefix": "oc_", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "mail_smtpport": "587", "theme": "", "memcache.local": "\OC\Memcache\APCu", "maintenance": true, "logtimezone": "UTC", "loglevel": 1, "mail_from_address": "LoomionServices", "mail_domain": "loomion.com", "secret": "REMOVED SENSITIVE VALUE", "forceSSLforSubdomains": true, "trashbin_retention_obligation": "auto", "mail_smtpmode": "smtp", "mail_smtphost": "smtp.office365.com", "mail_smtpsecure": "tls", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtpname": "REMOVED SENSITIVE VALUE", "mail_smtppassword": "REMOVED SENSITIVE VALUE", "updater.secret": "REMOVED SENSITIVE VALUE", "htaccess.RewriteBase": "/", "singleuser": false } }

Are you using external storage, if yes which one: local/smb/sftp/... No

Are you using encryption: yes/no No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder
  [Symfony\Component\Console\Exception\CommandNotFoundException]
  There are no commands defined in the "ldap" namespace.

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';
Empty set (0.01 sec)

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

boschma1 avatar Nov 17 '19 17:11 boschma1

I've got the same problem. Will it be fixed soon?

h4ndi avatar Jan 26 '20 14:01 h4ndi

If you search Google for this issue, you are going to find work arounds. This did the trick for me. However, it reset all document data to the current date. Please be careful.

boschma1 avatar Jan 26 '20 14:01 boschma1

As there is now a way to migrate from recent owncloud versions to Nextcloud 20, I suppose this issue isn't valid anymore. Please open a new issue if you should experience any problems with the new migration. Thanks! :)

szaimen avatar May 28 '21 11:05 szaimen