There are several issues around the migration support in the issue queue, with some interdependencies (not least of which is that none of them will work without incorporating #1832544: Class registration for Migrate 2.5 or later, and tests won't pass without #1835214: Automated tests failing - Exception thrown in Date2 migration). This will make it difficult, once maintenance of Date resumes, to pull them together into a coherent whole. And, until then, it's difficult for people to use the date migration support without each one trying to consolidate them. So, in this issue let's try to maintain an up-to-date consolidated patch - even if it isn't ultimately deemed suitable to commit as-is, migrators can make use of it in the meantime.

Issues covered include (along with contributors to be credited if the consolidated patch does get committed):

In current patch:
#1832544: Class registration for Migrate 2.5 or later - mikeryan
#1835214: Automated tests failing - Exception thrown in Date2 migration - PatchRanger
#1715700: Support for migrate v2.4 (subfields) - jsagotsky, mikeryan
#2034233: Refactor migration support - remove separate date_migrate module - mikeryan

Not yet included:
#1719290: Change date_migrate_example Feature to be listed within the "Migrate Examples" package - rupl
#1888268: Date migrate generates undefined index 'timezone' notices - mikran (but is there a reproducible problem?)
#1658106: Support date_all_day import in date_migrate. - no patch yet
#2021679: Empty/NULL date set to 12/31/1969 in migration - no patch yet (or may be a Migrate issue fixed for 2.6)

The issue summary will be updated as more Migrate issues are incorporated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeryan’s picture

Status: Active » Needs review
FileSize
9.52 KB

First shot at the patch, addressing the biggest issues.

mikeryan’s picture

Issue summary: View changes

Add new issue

mikeryan’s picture

Issue summary: View changes

Add more issues

mikeryan’s picture

Issue summary: View changes

Updated issue summary.

mikeryan’s picture

mikeryan’s picture

Issue summary: View changes

Updated issue summary

ShaunDychko’s picture

A newbie mistake to keep in mind when applying the patch above: use Git. Follow the instructions at https://drupal.org/project/date/git-instructions
If you use patch -p1 you get the following:

$ patch -p1 < date-consolidated_migrate-2.patch
patching file date.info
Hunk #1 succeeded at 4 with fuzz 1.
patching file date_migrate/date.migrate.inc
patching file date_migrate/date_migrate.info
Hunk #1 succeeded at 1 with fuzz 1.
patching file date_migrate/date_migrate.module
patching file date_migrate/date_migrate_example/date_migrate_example.info
patching file date_migrate/date_migrate_example/date_migrate_example.migrate.inc
patching file date_migrate/date_migrate_example/date_migrate_example.module
patching file date_migrate/date_migrate.test

and most importantly the date.migrate.inc file doesn't get moved from ../date/date_migrate/ to ../date/ when patch -p1 is used, leaving you confused about why the :timezone subfield doesn't appear with drush mfd. But all is well with git.

bc’s picture

Status: Needs review » Reviewed & tested by the community

Works for me - migrated in a bunch of records with value/value2-containing date fields.

Thanks so much for this consolidated patch.

Dave Reid’s picture

Confirmed this was required in order to migrate a multiple-value date field with start and end values. +1 to commit.

Dave Reid’s picture

I'm also encountering that this patch is only sort-of applied with Drush make since it makes the changes to date.migrate.inc, but doesn't move the file.

Dave Reid’s picture

I needed a patch file that did not do a rename/move on the date.migrate.inc file for Drush make, so here's the same thing with git diff --no-renames

philipz’s picture

I'm little confused by date_migrate_example. Is setting end date for date range field in prepareRow still necessary when using new :to target?
I've applied #1 patch but can't get this to work - only first date is migrated.

Edit:
Looks like it's working well after all. If I'm correct in case the end date is the same as start date it's not migrated.

cafuego’s picture

Status: Reviewed & tested by the community » Fixed

I have committed the combined meta patch for the following issues:

I'll update the status on each of those individual issues as well.

If you want to work on the other four patches mentioned in the issue summary, please just reopen this issue.

mikeryan’s picture

Thanks so much!

bc’s picture

yay! thanks!

Anonymous’s picture

Thank you!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Refactoring added to patch