Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When migrating nodes from Drupal 6 to Drupal 7, Statistics fields are mapped, but the node_counter table is not joined on the DrupalNode6Migration::query(). See the following:
Used as source field in mapping but not in source field list:
daycount
timestamp
totalcount
I believe this is also the case when migrating from Drupal 5, but I'm not familiar enough with D5 to even know if the Statistics module is available in D5.
Proposed resolution
In DrupalNode6Migration::query(), implement a check for the node_counter table and join node_counter if it is available.
Something similar may be needed for DrupalNode5Migration.
Remaining tasks
Fix for DrupalNode6Migration- Fix for DrupalNode5Migration if necessary
Comment | File | Size | Author |
---|---|---|---|
#1 | migrate_d2d-statistics-mapping-fails-2150781-1.patch | 609 bytes | colinafoley |
Comments
Comment #1
colinafoley CreditAttribution: colinafoley commentedHere's the first pass at DrupalNode6Migration. Just worked for me on the migration I'm writing.
Comment #2
gawrion CreditAttribution: gawrion commentedHey - while ago i've testet that query for D5 and it also works for me. Table node_count is simply the same i think ;)
Comment #3
internets CreditAttribution: internets commentedThank you! I was wondering why my view "totalcount" for migrated nodes were 0.
This patch made the statistics properly migrate for a Drupal 6 to Drupal 7 node.
Using the following modules along with a custom migration module.
Comment #4
hussainwebThe patch looks good and applies okay. I tested it and it works fine.
Comment #5
mikeryanCommitted (plus support for D5 and D7), thanks!