When the blog has a title longer than MySQL allows for table names, users get this error...

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name 'migrate_message_': CREATE TABLE {migrate_message_} ( `msgid` INT unsigned NOT NULL auto_increment, `sourceid1` VARCHAR(255) NOT NULL COMMENT 'WordPress category machine name', `level` INT unsigned NOT NULL DEFAULT 1, `message` MEDIUMTEXT NOT NULL, PRIMARY KEY (`msgid`), INDEX `sourcekey` (`sourceid1`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Messages generated during a migration process'; Array ( ) in MigrateSQLMap->ensureTables() (line 148 of /sites/all/modules/migrate/plugins/sources/sqlmap.inc).

I fixed it by changing the title in the WXR file from...

<channel>
	<title>My WordPress Blog - With a Catchy Catch Phrase Included in the Title</title>

To...

<channel>
	<title>My WordPress Blog</title>

Comments

mikeryan’s picture

Project: WordPress Migrate » Migrate
Version: 7.x-1.x-dev » 7.x-2.x-dev
Assigned: Unassigned » mikeryan

The Migrate module MigrateSQLMap constructor should truncate the map and message table names as necessary.

mikeryan’s picture

Title: Table creation fails when blogs have really long titles » Long machine names cause failures creating map/message tables
mikeryan’s picture

Status: Active » Fixed

OK, migrate now truncates map and message table names to 63 characters (good for MySQL, Postgres, and SQLite).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.