migration tool fails at database import...

Discussion in 'ISPConfig 3 Priority Support' started by flyingaggie, Sep 14, 2024 at 7:20 AM.

  1. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    Hey guys,

    Anyone used the migration tool and have it fail with "error code 1" after it attempts to import the first database? I can't find a reference to what error code 1 is so I can try to trace down the problem. When I did the dry run, it never asked for the mysql password as the howto guide here says it will. Everything else has moved and sync'd, but I can't get my databases over from another 3.2.x machine (slightly behind the new server version, but both on the 3.2.x branch). gzip/gunzip is installed on the new server, so I don't think it's the pre-pipe part. I'm guessing it's in the mysql part, but can't find anything. I'm able to login to mysql with the proper password for root with no problems on the new machine. There's nothing helpful in my mysql or mysql error log. Hopefully someone has an idea that can point me in the right direction as I'd really like to finish this migration soon.

    Thanks for any help!
    Tim

    Below is the excerpt from the migrate log:

    Code:
    2024-09-13 08:29:30 - [INFO] Successfully executed command replace -? 2>/dev/null
    2024-09-13 08:29:30 - [INFO] Successfully executed command if [ ! -d '/tmp/dumps' ] ; then mkdir -p '/tmp/dumps' ; fi
    2024-09-13 08:29:30 - [INFO] Successfully executed command for T in `mysql -h 'localhost' -u 'root' db3db1 -e 'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "VIEW"' | awk '{ print $1}' | grep -v '^Tables'` ; do mysql -h 'localhost' -u 'root' db3db1 -e "SET FOREIGN_KEY_CHECKS=0; DROP VIEW \`$T\`; SET FOREIGN_KEY_CHECKS=1;" ; done
    2024-09-13 08:29:30 - [INFO] Successfully executed command for T in `mysql -h 'localhost' -u 'root' db3db1 -e 'SHOW FULL TABLES WHERE TABLE_TYPE NOT LIKE "VIEW"' | awk '{ print $1}' | grep -v '^Tables'` ; do mysql -h 'localhost' -u 'root' db3db1 -e "SET FOREIGN_KEY_CHECKS=0; DROP TABLE \`$T\`; SET FOREIGN_KEY_CHECKS=1;" ; done
    2024-09-13 08:29:32 - [INFO] Successfully executed command umask 0077 ; R="" ; if [ "$(mysqldump --help | grep '\-\-routines' >/dev/null 2>&1 ; echo $?)" -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'<real password>' db3db1 | gzip -6 > '/tmp/dumps/db3db1.sql.gz'
    2024-09-13 08:29:32 - [INFO] File /tmp/migrate-import-tmp.sql.gz successfully transferred.
    2024-09-13 08:29:32 - [INFO] Command gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=128M -h 'localhost' -D db3db1 -u 'root' failed with code 1.
    2024-09-13 08:29:32 - [ERROR] Execution of job failed: array (
      'type' => 'exec',
      'command' => 'gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=128M -h \'localhost\' -D db3db1 -u \'root\'',
      'info_message' => 'Propagating database db3db1',
      'stop_on_error' => true,
    )
     
    Last edited: Sep 14, 2024 at 7:42 AM
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I already emailed you the answer to the same question yesterday morning. Please follow the instructions I sent you, and if this does not work, contact me again by email. As I wrote in my email, run the command mentioned in the error message to see why your new server rejects the SQL dump. And the MySQL root password is in the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf, so the tool does not need to ask for the password. Just take care to not alter mysql root passwords as this might cause ISPConfig to fail and the tool will fail then too unless you changed the password in that file correctly.
     
  3. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    Sorry Till,
    I've checked my email/spam/trash, but do not see anything from you from today. The howtoforge.com emails come through, but I don't see any responses. I just updated my email to a gmail account and re-validated my account so hopefully it won't happen again. I'm very sorry for the trouble and thought it was odd I didn't hear from you today.
     
    Last edited: Sep 14, 2024 at 3:49 PM
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I've just send you the email to your gmail address. I hope it has arrived now.
     
  5. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    Thanks Till! I'll give that a shot and report back any findings!
     
  6. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    So, two things:
    1) I don't have the mysql_clientdb.conf file in that directory (if that matters)
    2) When I run that command that fails on the command line from within the /tmp directory it fails with "Error at line 1: Unknown command '\-'

    I ran the command exactly as it is in the log (minus the error message portion at the beginning and end, of course).
     
  7. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    The first line of the .gz file contains when gunzip'd:
    "/*!999999\- enable the sandbox mode */" (no quotes of course)
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    This file must exist on any ISPConfig server; ISPConfig can not work without it. Please double-check that your new server does not have it. Output from an ISPConfig system:

    Code:
    root@server1:~# ls -la /usr/local/ispconfig/server/lib/mysql_clientdb.conf
    -rw------- 1 root root 115 Sep  5 20:16 /usr/local/ispconfig/server/lib/mysql_clientdb.conf
    You ran this exact command incl. the gunzip part?

    Code:
    gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=128M -h 'localhost' -D db3db1 -u 'root'
     
  9. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    Not sure why, but it wasn't showing last night and I checked that directory several times. Anyway, the file is there today, so I was apparently incorrect on that. The login and password are correct in that file.

    Code:
    root@:/tmp# gunzip -c /tmp/migrate-import-tmp.sql.gz | mysql --max_allowed_packet=128M -h 'localhost' -D db3db1 -u 'root'
    ERROR at line 1: Unknown command '\-'.
    root@:/tmp#
    
    Unless I'm missing something, I'm running it exactly as it was in the log (I copy pasted the log to the command line). I also copied it this morning from your email and received the same result as above.

    If I run just the gunzip -c /tmp/migrate-import-tmp.sql.gz, line 1 displays:
    Code:
    /*!999999\- enable the sandbox mode */
    The entire output is:
    Code:
    /*!999999\- enable the sandbox mode */
    -- MariaDB dump 10.19  Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64)
    --
    -- Host: localhost    Database: db3db1
    -- ------------------------------------------------------
    -- Server version       10.6.18-MariaDB-0ubuntu0.22.04.1
    
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8mb4 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    
    --
    -- Dumping routines for database 'db3db1'
    --
    /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    
    -- Dump completed on 2024-09-14  5:14:19
    
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Which mysql or mariadb version do you use on the old server, and which mysql or mariadb on the new system? It seems as if the new version cannot read the dumps created by the mysqldump command on the old server. I have not seen this error on any system yet, I'll forward it to the developer of the migration tool. Please respond to the email instead of posting here as this would make support easier. I could forward your answers to those who can help you with this.
     
  11. flyingaggie

    flyingaggie New Member HowtoForge Supporter

    Thanks Till, I'll respond to your email you sent.
     

Share This Page