Issue: Importing data from 0.11.7 into 1.24.6 has errors on MySQL


#1

Issue Summary

When importing an exported database from Ghost 0.11.7 into Ghost 1.24.6 results in Import failed. The debug error is seen below

ERROR [2018-07-02 01:29:35] “POST /ghost/api/v0.1/db/” 500 1373ms

NAME: DataImportError
CODE: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD

Complete Error log at: https://github.com/TryGhost/Ghost/issues/9711#issuecomment-401807593

To Reproduce

Export data from Ghost 0.11.7, (probably using similar data in sample data above)
Import to Ghost 1.24.7 using MySQL as the database
This error only happens on MySQL, using SQLite doesn’t cause this error. Both the import and export data are from a MySQL database originally. I am now temporarily using SQLite as my database for production

Technical details:

Ghost Version: 1.23.6
Node Version: 8.9.1
Browser/OS: Chrome 67.033396.99/Mac OS High Sierra
Database: MySQL 5.7.19
Database Encoding: utf8


#2

Hi @paulopmx

Did you get this solved?? If I had to guess, I’d say your content contains emoji / 4-byte UTF-8 characters and your DB / tables are setup with UTF8 collation which is the default.

A quick Google search for ER_TRUNCATED_WRONG_VALUE_FOR_FIELD returned a lot of similar issues and solutions. For example:

There’s a reasonable post here giving a little more information about utf8 and MySQL.

Hopefully that helps.

If not, please update with a bit more information about the migration. Did you create the DB yourself first? Are you using the root DB user to create a Ghost DB / user for you? I’m not entirely sure how the Ghost exporter / importer functions.