Search Engine: Elastic

Article ID: 4563, created on Mar 24, 2008, last review on Apr 17, 2012

  • Applies to:
  • Sphera


MySQL errors  while migrating VDSs from SD3.7 to SD4.1.1.

Resolution (Failed to restore MySQL database.)

Please find attached script by our developers.

They have prepared a fix which solves some migration issues.

This fix should be transferred to migration source (SD3.7) machine before migration and just ran once.
It fixes 2 issues:

1. Bug in sockets handling causing Runtime error in the start of migration

2. MySQL migration problem.
    After the fix the following procedure will help migrating VDSs that were failed restoring Mysql Databases:

    1. Investigate the migration.log on destination machine and find an exact cause.
        Problem description and line number in mysql dump file usually can be found there.

    2. on source machine
        su - [VDS_USER_NAME] -s /bin/chrootsh
        mkdir /migration_custom
        run /usr/bin/mysqldump -A --opt --quote-names > /migration_custom/my.sql
        cp /migration_custom/my.sql /migration_custom/my.sql.bad
        Edit /migration_custom/my.sql (e.g with vi) and fix problems found in item 1.

        Try to find and fix not only the one specific line specified in the log, but also similar issues in the rest of the dump file, because only first problem is written in the log file.

    3. Perform migration (Export error: Failed to dump MySQL database.)

This can be caused by one of two reasons:

1. mysqldump utility cannot connect to server with login details specified for client in VDS/etc/my.cnf file, probably because the password was changed by the VDS owner using SQL commands instead of doing it using VDS CP.

VDS owner should fix the password in VDS/etc/my.cnf accordingly.

2. The other reason is that mysqld is not running for VDS.
In this case mysql service should be restarted for VDS.


5f478287f7e74fe9b07217d8131cd741 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF