I am finding it very difficult to set up simplest migrations with my current setup up (new drupal-7.38). I have raised other issues and (for now) given up on node-with-image migration as I cannot work out the correct settings in the UI. Im getting errors trying to migrate a simple node with a text body. The migration completes - without the text body - with the following error:

Migration failed with source plugin exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.migrate_map_112abd9b1nodesimpletext WHERE needs_update = 1' at line 1, in /home/migrate1.drupal7.com/public_html/www/includes/database/database.inc:2171

When I list content (I'm seeing the following pair of errors repeated many times:

Notice: Undefined offset: 24 in user_node_load() (line 3682 of /home/migrate1.drupal7.com/public_html/www/modules/user/user.module).
Notice: Trying to get property of non-object in user_node_load() (line 3682 of /home/migrate1.drupal7.com/public_html/www/modules/user/user.module).
...

This is working on a new drupal 7-38 install with minimal additional modules.

Comments

Syntapse’s picture

The text body IS being imported but is not being displayed because the body format is not being correctly mapped and is undefined in the destination node. The mapping has been defined for the migration.

Destination Source Default Description Priority
body body OK
body:format body:format OK
body:language und OK
body:summary body:summary OK
changed changed OK
comment comment OK
created created OK
language language und OK
path path Handled in prepareRow OK
promote promote OK
status status OK
sticky sticky OK
title title OK
tnid tnid OK
translate translate OK
uid

As this is a complex module can you advise on the best way to test future iterations to ensure that base functionality is working as expected

thanks

laurence.

Syntapse’s picture

Issue summary: View changes
mikeryan’s picture

Category: Bug report » Support request
Priority: Major » Normal
mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

So, one thing at a time:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.migrate_map_112abd9b1nodesimpletext WHERE needs_update = 1'

It would be helpful if the database layer displayed the full query here... The period before the table name is suspicious, there should be a database name before that, can't be sure if it was missing in the actual query or just omitted in the message. The database name should be coming from DatabaseConnection::getConnectionOptions(), could there be something funky in how you have the Drupal database configured?

As for the user_node_load() errors, it's hard to see how that would be happening, unless somehow nodes end up with bad uids. Which, if the user migration was failing, might explain it... So, let's focus on the map table error - unfortunately, it's hard to speculate from here, it really needs debugging.

mikeryan’s picture

Title: compatibility status for drupal-7.38? » Map table syntax error on node migration
Syntapse’s picture

i think this needs to be changed back to a bug (not a support request). also: not being able to migrate data is fairly major.

mikeryan’s picture

Without anyone else reporting the same problem, it seems more likely that there's an issue specific to your environment than that there's a general bug in migrate or migrate_d2d. Unfortunately, there isn't really any information here from which I can guess what that issue might be - is there anything additional you can share, particularly if there's anything unusual about how your database connection is defined?

spidersilk’s picture

I'm getting this error too, although on importing files rather than nodes. And there's nothing unusual about the database setup in this case... The file migration code is really straightforward - I didn't change anything from the one in the example module except for the name and description. Plus there's another issue I saw here from someone else getting the same error. So it's not just one person getting it...

spidersilk’s picture

Ah - a co-worker found the solution in our case, from here: https://www.drupal.org/node/1696152#comment-10211107

So it's hyphens in db names that were causing our problem - looking at the OP's SQL error, maybe periods in db names cause the same problem?

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)