D7 upgrade migration test shows incorrect node created, updated values are migrated

Created on 16 August 2022, over 2 years ago
Updated 14 December 2023, about 1 year ago

Problem/Motivation

The migration tests show that the wrong data is migrated on a D7 site.

In drupal7.php node 1 has the following in the "node" table:

->values(array(
  'nid' => '1',
  'vid' => '1',
  'type' => 'test_content_type',
  'language' => 'en',
  'title' => 'A Node',
  'uid' => '2',
  'status' => '1',
  'created' => '1421727515',
  'changed' => '1441032132',
  'comment' => '2',
  'promote' => '1',
  'sticky' => '0',
  'tnid' => '0',
  'translate' => '0',
))

The "node_revisions" record for the same node has the following:

->values(array(
  'nid' => '1',
  'vid' => '1',
  'uid' => '1',
  'title' => 'A Node',
  'log' => '',
  'timestamp' => '1441032132',
  'status' => '1',
  'comment' => '2',
  'promote' => '1',
  'sticky' => '0',
))

This data is consistent - the original creation was 1421727515, which corresponds to values in both "file_managed" and "taxonomy_index", and it was then updated at 1441032132.

However, after the migration runs the "created" and "changed" values are set to 1529615790, which come from "entity_translation" and "entity_translation_revision".

Why is the core migration not using the values taken from the "node" and "node_revision" tables?

Proposed resolution

Update the dates in the database, see #6.

Other options suggested:
Either:
1. Update the tests so that the "created" and "updated" values are consistent across all relevant tables.
2. Update the migration logic to use the "created" and "updated" values from the "node" and "node_revision" tables in preference to values obtainable elsewhere, e.g. in "entity_translation" and "entity_translation_revision".

Remaining tasks

Commit

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

TBD

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024