Migration tool not transferring databases

Discussion in 'ISPConfig 3 Priority Support' started by s_digicom, Sep 27, 2021.

  1. s_digicom

    s_digicom New Member HowtoForge Supporter

    During the migration process, almost at the end of the process, the tool starts to migrate databases and then errors occur:
    On the display:
    ERROR 1049 (42000): Unknown database '********'t
    ERROR 1049 (42000): Unknown database '********'t
    ERROR 1049 (42000): Unknown database '********'
    [ERROR] job failed

    In the log file:
    21-09-27 09:39:32 - [INFO] Successfully executed command rm -f '/tmp/migrate-import-tmp.sql.gz' ;
    2021-09-27 09:39:33 - [INFO] Successfully executed command rm -rf '/tmp/dumps'
    2021-09-27 09:39:33 - [INFO] Successfully executed command if [[ ! -d '/tmp/dumps' ]] ; then mkdir -p '/tmp/dumps' ; fi
    2021-09-27 09:39:34 - [INFO] Successfully executed command for T in `mysql -h 'localhost' -u 'root' -p'**********' c1eltransport -e 'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "VIEW"' | awk '{ print $1}' | grep -v '^Tables'` ; do mysql -h 'localhost' -u 'root' -p'***********' c1eltransport -e "SET FOREIGN_KEY_CHECKS=0; DROP VIEW \`$T\`; SET FOREIGN_KEY_CHECKS=1;" ; done
    2021-09-27 09:39:34 - [INFO] Successfully executed command for T in `mysql -h 'localhost' -u 'root' -p'**********' c1eltransport -e 'SHOW FULL TABLES WHERE TABLE_TYPE NOT LIKE "VIEW"' | awk '{ print $1}' | grep -v '^Tables'` ; do mysql -h 'localhost' -u 'root' -p'*************' c1eltransport -e "SET FOREIGN_KEY_CHECKS=0; DROP TABLE \`$T\`; SET FOREIGN_KEY_CHECKS=1;" ; done
    2021-09-27 09:39:36 - [INFO] Successfully executed command umask 0077 ; R="" ; if [[ $(mysqldump --help | grep '\-\-routines' >/dev/null 2>&1) -eq 0 ]] ; then R=" --routines" ; fi ; mysqldump -cCQ --no-tablespaces --triggers $R --quote-names --hex-blob --max_allowed_packet=1G --opt --quick -h 'localhost' -u 'root' -p'*************' c1eltransport | gzip -6 > '/tmp/dumps/c1eltransport.sql.gz'
    2021-09-27 09:39:36 - [INFO] File /tmp/migrate-import-tmp.sql.gz successfully transferred.
    2021-09-27 09:39:37 - [INFO] Command gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=1G -h 'localhost' -D c1eltransport -u 'root' -p'*********************' failed with code 1.
    2021-09-27 09:39:37 - [ERROR] Execution of job failed: array (
    'type' => 'exec',
    'command' => 'gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=1G -h \'localhost\' -D c1eltransport -u \'root\' -p\'***********\'',
    'info_message' => 'Propagating database c1eltransport',
    'stop_on_error' => true,
    )
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please run the command manually on the shell of the new server:

    gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=1G -h 'localhost' -D c1eltransport -u 'root' -p'***********'

    to see which error you get. Replace the * in the command with the correct MySQL root password.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    and check if the database c1eltransport exists in /var/lib/mysql folder. if it does not exists, then you probably have a wrong MySQL root password in the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf on the new server, which would prevent that ISPConfig is able to add databases and database users.
     
  4. s_digicom

    s_digicom New Member HowtoForge Supporter

    Hi Till, thank you very much for the prompt reply.
    You were right, in /usr/local/ispconfig/server/lib/mysql_clientdb.conf I had the wrong password. But this does not solve the issue completely, the tool succeeds to import about 50 databases and refuses to import the remaining ~80 db with the same output in the log.
    When tried to pass the command:
    gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=1G -h 'localhost' -D c1eltransport -u 'root' -p'******'
    MySQL respond with ERROR 1049 unknown database which was expected.
    All the databases from the old server exist in ISPConfig web interface but are not created in MySQL.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    That's due to the wrong root password, if ISPConfig has no root access to MySQL, it can't create any databases. The data import must fail when there is no database on the target system. Use Tools > Resync in ISPConfig on the new system and enable databases there to let ISPConfig create the databases. Then run the migration tool again with resync option to resync the data for them.
     
  6. s_digicom

    s_digicom New Member HowtoForge Supporter

    Thank you very much, Till ! Everything passed smoothly, the new server is online.
     

Share This Page