Articles in this section

Plesk migration fails: Invalid default value for 'field_name'

Plesk for Windows Plesk for Linux kb: technical ext: migrator ABT: Group A

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

  • A migration fails with the following error:

    CONFIG_TEXT: Migration tools tried to perform operation in 3 attempts: Command execution failed on the local server with non-zero exit code.
    command: mysql --defaults-file=/usr/local/psa/var/modules/panel-migrator/sessions/<datetime>/target-server/my_db.cnf -h localhost -P 3306 -uadmin my_db < /usr/local/psa/var/modules/panel-migrator/sessions/<datetime>/target-server/db-dumps/my_db.sql
    exit code: 1
    stdout:
    stderr: ERROR 1067 (42000) at line 487: Invalid default value for 'date_updated'

  • A database restoration can also fail with the following error:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin database < /var/lib/mysql/database2
    ERROR 1067 (42000) at line 1022: Invalid default value for 'created_at'

  • The source server has Plesk with MySQL 5.6.5, while the target has Plesk with MySQL 5.6.4 or older
  • The line 487 of the dump is specified as follows:

    CONFIG_TEXT: date_updated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

Cause

This is caused due MySQL bug with ID 27645: Datetime field does not accept default NOW()

Resolution

Apply one of the following solutions:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.