0

I am building a migration and it is important that each new node has the same creation time stamp as the cosponsoring data in the old system. How do I set the creation time of a node during a migration using the Migrate module? I am assuming that it is set by a specific call to addFieldMapping()

2 Answers 2

1

I've been using prepareRow in my class to solve this kind of problem .

First of all I add a new Source Field to the MigrateSourceSQL

$source_fields = array(
  'created' => t('the created date'),

then in prepareRow I added the php for the timestamp and attached it to the row.

$row->changed = $nowtimestamp;

And then assign with addFieldMapping

$this->addFieldMapping('field_created_date', 'changed' );

This seems to work fine for me.

0

After creating your migration module and activating it, you will find one or more migration entries in your migration menu (found at admin/content/migrate.) Click on the migration that you are working on. On the next screen, click on the Destination link in the sidebar menu.

This will display a list of all available migration field names, including creation time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.