Convert Postgresql database to Mysql

Nextcloud version : 27.1.9
Operating system and version : docker stack (debian)
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version: 8.2

The issue you are facing:

Is this the first time you’ve seen this error? Y:

Steps to replicate it:

I need migrate a nextcloud instance running with a postgresql DB in a new one with MariaDB DB, I have added a mariadb container on the docker-compose and try the command php occ db:convert-type --all-apps mysql mysql_user mariadb new_bdd

The conversion seems running at first, but stop at this point with the table oc_cards

- oc_cards
 200/368 [===============>------------]  54%  1 sec/2 secs
In ConnectionException.php line 23:

In ConnectionException.php line 23:
                                   
  There is no active transaction.  
                                   

db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--] <type> <username> <hostname> <d
atabase>

Perhaps if I removing this table could help ?? How use --chunk-size CHUNK-SIZE before run this action ??

The output of your Nextcloud log in Admin > Logging: Nothing about




The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array ( 
  'default_language' => 'fr',
  'force_language' => 'fr',
  'default_locale' => 'fr_FR',
  'force_locale' => 'fr_FR',
  'instanceid' => 'xxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'openssl' =>
  array (
    'config' => '/etc/ssl/openssl.cnf',
  ),
  'version' => '27.1.9.1',
  'datadirectory' => '/var/www/data',
  'skeletondirectory' => '/var/www/data/__groupfolders/18/[DOSSIER-GENERIQUE]_nouveaux-utilisateurs',
  'dbtype' => 'pgsql',
  'dbname' => 'userdb',
  'dbhost' => 'pgsql',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'userdb',
  'dbpassword' => 'xxxxxxxx',
  'installed' => true,
  'trusted_proxies' =>
  array (
    0 => '172.18.0.0/24',
  ),
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'theme' => '',
  'loglevel' => 0,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\MarkDown',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\Illustrator',
    9 => 'OC\\Preview\\Movie',
    10 => 'OC\\Preview\\MSOffice2003',
    11 => 'OC\\Preview\\MSOffice2007',
    12 => 'OC\\Preview\\MSOfficeDoc',
    13 => 'OC\\Preview\\OpenDocument',
    14 => 'OC\\Preview\\PDF',
    15 => 'OC\\Preview\\Photoshop',
    16 => 'OC\\Preview\\Postscript',
    17 => 'OC\\Preview\\StarOffice',
    18 => 'OC\\Preview\\SVG',
    19 => 'OC\\Preview\\TIFF',
    20 => 'OC\\Preview\\Font',
  ),
  'app_install_overwrite' =>
  array (
    0 => 'announcementcenter',
    1 => 'ownpad',
  ),
  'data-fingerprint' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'port' => 6379,
  ),
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://domain-preprod.tld',
  'trusted_domains' => 
  array (
    0 => 'domain-preprod.tld',
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'mails.domain.tld',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'noreply',
  'mail_domain' => 'domain-mail.tld',
  'mail_smtpauth' => false,
  'mail_smtpport' => '1025',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => '',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
);

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

well I haven’t found information… perhaps need |grep something but I havent found

I am loocking for this line… but where is this file ???

/var/www/html# find -name ConnectionException.php 
./apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionException.php
./custom_apps/collectives/vendor/predis/predis/src/Connection/ConnectionException.php
./3rdparty/doctrine/dbal/src/ConnectionException.php
./3rdparty/doctrine/dbal/src/Exception/ConnectionException.php

But all these files haven’t a line 25…

or perhaps in root path in the /proc/xxx/files ??

/# find -name ConnectionException.php
./usr/src/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionException.php
./usr/src/nextcloud/3rdparty/doctrine/dbal/src/Exception/ConnectionException.php
./usr/src/nextcloud/3rdparty/doctrine/dbal/src/ConnectionException.php
find: './proc/39/map_files': Permission denied
find: './proc/163/map_files': Permission denied
find: './proc/444/map_files': Permission denied
find: './proc/452/map_files': Permission denied
find: './proc/464/map_files': Permission denied
find: './proc/510/map_files': Permission denied
find: './proc/513/map_files': Permission denied
find: './proc/519/map_files': Permission denied
find: './proc/523/map_files': Permission denied
find: './proc/525/map_files': Permission denied
find: './proc/527/map_files': Permission denied
./var/www/html/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionException.php
./var/www/html/custom_apps/collectives/vendor/predis/predis/src/Connection/ConnectionException.php
./var/www/html/3rdparty/doctrine/dbal/src/ConnectionException.php
./var/www/html/3rdparty/doctrine/dbal/src/Exception/ConnectionException.php

I have yet done this test, and after change the config.php and connect the container mariadb, restart with the new mysql, but I can’t login… nextcloud works, but I think not all the tables are here so, it is not efficient