Database conversion crash

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
  • Operating system and version (e.g., Ubuntu 24.04):
    • openSUSE Leap 15.6
  • Web server and version (e.g, Apache 2.4.25):
    • apache2, 2.4.66
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • none atm, I am testing on a offline copy
  • PHP version (e.g, 8.3):
    • PHP 8.2.30
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes, this is my first attempt to convert a database
  • When did this problem seem to first start?
    • at first attempt
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Cant remember
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

In preparation for moving to All-In-One I want to convert the database from mariadb to postgrsql, but conversion breaks down after a while.

Steps to replicate it (hint: details matter!):

There is currently 2 servers in this setup, a database host and a apache host. Both are cloned from the production ones, and slightly modified to run with internal servernames/ip

  1. added postgresql on the database host and set it up for receiving the database as described on migration page.

  2. verified that Nexcloud was responding in the cloned setup and that I could establish connection to postgreSQL from the web server

  3. start migration using the occ db:convert-type command (se full command in log below)

Log entries

Nextcloud

Ran this on the command line, so I guess this is more relevant:

localadm@skykino-02:~> sudo -u wwwrun -s /srv/www/htdocs/nextcloud/occ db:convert-type --all-apps --port 5432 --password "$PG_PASSWORD" pgsql "$PG_USER" 192.168.80.131 "$PG_DATABASE"
PHP Warning:  Module "pgsql" is already loaded in Unknown on line 0
PHP Warning:  Module "pdo_pgsql" is already loaded in Unknown on line 0
Creating schema in new database
 - fileslibreofficeedit
 - dav
 - appstore
 - previewgenerator
 - tasks
 - dashboard
 - breezedark
 - suspicious_login
 - circles
 - survey_client
 - password_policy
 - files_pdfviewer
 - weather_status
 - theming
 - settings
 - lookup_server_connector
 - files_external
 - admin_audit
 - passwords_handbook
 - mail
 - approval
 - notify_push
 - passwords
 - spreed
 - files_downloadlimit
 - related_resources
 - viewer
 - support
 - privacy
 - logreader
 - activity
 - user_status
 - twofactor_backupcodes
 - profile
 - files_versions
 - files
 - comments
 - shiftsnext
An unhandled exception has been thrown:
ParseError: syntax error, unexpected identifier "APP_ID", expecting "=" in /srv/www/htdocs/nextcloud/apps/shiftsnext/lib/AppInfo/Application.php:18
Stack trace:
#0 /srv/www/htdocs/nextcloud/lib/composer/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 /srv/www/htdocs/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php(151): class_exists()
#3 /srv/www/htdocs/nextcloud/lib/private/App/AppManager.php(497): OC\AppFramework\Bootstrap\Coordinator->bootApp()
#4 /srv/www/htdocs/nextcloud/core/Command/Db/ConvertType.php(222): OC\App\AppManager->loadApp()
#5 /srv/www/htdocs/nextcloud/core/Command/Db/ConvertType.php(176): OC\Core\Command\Db\ConvertType->createSchema()
#6 /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OC\Core\Command\Db\ConvertType->execute()
#7 /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php(1098): Symfony\Component\Console\Command\Command->run()
#8 /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#9 /srv/www/htdocs/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#10 /srv/www/htdocs/nextcloud/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run()
#11 /srv/www/htdocs/nextcloud/console.php(92): OC\Console\Application->run()
#12 /srv/www/htdocs/nextcloud/occ(33): require_once('...')

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

localadm@skykino-02:~> sudo -u wwwrun -s /srv/www/htdocs/nextcloud/occ config:list system
PHP Warning:  Module "pgsql" is already loaded in Unknown on line 0
PHP Warning:  Module "pdo_pgsql" is already loaded in Unknown on line 0
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "sky.kinokultur.dk",
            "sky.kino-kultur.dk",
            "skykino.tier1.internal",
            "skykino-02.tier1.internal"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/sky.kinokultur.dk\/",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "version": "34.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "installed": true,
        "logtimezone": "Europe\/Copenhagen",
        "default_phone_region": "DK",
        "loglevel": 2,
        "log_type": "syslog",
        "logfile": "",
        "syslog_tag": "Nextcloud",
        "filelocking.enabled": true,
        "maintenance_window_start": 3,
        "maintenance": false,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": true,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "shifts"
        ],
        "theme": "",
        "files.chunked_upload.max_size": 20971520
    }
}

Apps

The output of occ app:list (if possible).

localadm@skykino-02:~> sudo -u wwwrun -s /srv/www/htdocs/nextcloud/occ app:list
PHP Warning:  Module "pgsql" is already loaded in Unknown on line 0
PHP Warning:  Module "pdo_pgsql" is already loaded in Unknown on line 0
Enabled:
  - activity: 7.0.0
  - app_api: 34.0.0
  - approval: 3.3.1
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - calendar: 6.5.4
  - circles: 34.0.0
  - cloud_federation_api: 1.18.0
  - comments: 1.24.0
  - contacts: 8.8.0
  - contactsinteraction: 1.15.0
  - dashboard: 7.14.0
  - dav: 1.40.0
  - deck: 1.18.4
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_downloadlimit: 5.2.0
  - files_lock: 34.0.1
  - files_pdfviewer: 7.0.0-dev.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - fileslibreofficeedit: 2.0.1
  - firstrunwizard: 7.0.0-dev.0
  - forms: 5.3.6
  - groupfolders: 22.0.6
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - mail: 5.11.5
  - nextcloud_announcements: 6.0.0
  - notifications: 7.0.0-dev.1
  - notify_push: 1.4.0
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - passwords: 2026.7.10
  - passwords_handbook: 2026.7.20
  - photos: 7.0.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - recommendations: 7.0.0
  - related_resources: 5.0.0-dev.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - spreed: 24.0.4
  - support: 6.0.0
  - survey_client: 6.0.0-dev.0
  - suspicious_login: 12.0.0-dev.0
  - systemtags: 1.24.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_nextcloud_notification: 8.0.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0
  - breezedark: 29.0.0 (installed 29.0.0)
  - encryption: 2.22.0
  - files_external: 1.26.0
  - polls: 9.1.4 (installed 9.1.4)
  - previewgenerator: 5.14.0 (installed 5.14.0)
  - secrets: 3.0.3 (installed 3.0.3)
  - shiftsnext: 2.1.0
  - tasks: 0.18.1 (installed 0.18.1)
  - testing: 1.23.0
  - twofactor_admin: 4.11.1 (installed 4.11.1)
  - user_ldap: 1.25.0

The error isn’t directly coming from the DB conversion itself but from the app shiftsnext. From your other output that’s a disabled (but still installed) app in your environment.

You may want to not use --all-apps and/or uninstall that app entirely if not using it:

Thank you! I deleted the app and that solved it - currently running the conversion :grin:

Continues in Database crash - part 2 and 3