With much humbleness, I wonder why the current migrate UI migrates everything but to 301 redirects...

What will a site owner do with say 100-1000 (or more) redirects made in Drupal 7 with Global Redirect from whatever reason?

I think we cannot except people to copy their redirections manually or to pay for such a customized solution...

I would personally glad to use such a feature. Will thank you for your opinions...

Comments

Benia created an issue. See original summary.

berdir’s picture

Redirect actually includes a migration template, I'm using this on one of our sites that we are updating from.

Maybe it needs some changes after the core changes in 8.1.0. But we have a test and that is working.

berdir’s picture

Ah, Drupal 7. I think there is currently only a migration for path_redirect for 6.x. You can look at that and implement a similar one for 7.x.

Benia’s picture

Issue summary: View changes
jofitz’s picture

Title: Why does the Migrate UI don't migrate redirects ? » Migrate D7 redirects to D8
Status: Active » Needs review
Issue tags: +migrate-d7-d8
StatusFileSize
new4.92 KB

Created a patch for D7 -> D8 redirects migration.

(This will display a warning on /upgrade, but that is an issue with core, see #2569805: For Drupal migration, identify the source module).

ckaotik’s picture

Please declare the dependency on migrate_drupal and the path_redirect module being present in the source installation in the annotation, see #2744721: Migration Templates depend on migrate_drupal.

jofitz’s picture

StatusFileSize
new9.93 KB
new5.87 KB

Added tests for d7 migration (and a few missing newlines at ends of files).

jofitz’s picture

StatusFileSize
new9.98 KB
new1005 bytes

Added changes recommended by @ckaotik - test failure expected.

Status: Needs review » Needs work

The last submitted patch, 8: migrate_d7_redirects-2715807-8.patch, failed testing.

The last submitted patch, 8: migrate_d7_redirects-2715807-8.patch, failed testing.

jofitz’s picture

Status: Needs work » Postponed
Related issues: +#2560795: Source plugins have a hidden dependency on migrate_drupal

Issue now on hold because it depends on the patch in #2560795: Source plugins have a hidden dependency on migrate_drupal.

mikeryan’s picture

Status: Postponed » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: migrate_d7_redirects-2715807-8.patch, failed testing.

jofitz’s picture

StatusFileSize
new1.24 KB
new10.68 KB

Handle status codes of 0 (i.e. default status codes).

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new7.23 KB
new14.3 KB

Added status code check to tests and general readability improvements.

Corrected source_provider and made necessary additions to test fixtures so that it now passes tests.

jofitz’s picture

StatusFileSize
new2.03 KB
new15.72 KB

Added Unit test to redirect migration.

manu manu’s picture

Works well for me, thanks for working on this.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, has tests and has been tested manually. Sounds like this is ready.

jofitz’s picture

What do we need to do to get this committed?

G42’s picture

I have tried this patch on the dev and alpha versions and the Drupal migrate UI keeps registering Redirect migration as missing. Can you provide details on how you got this patch to work?

berdir’s picture

Status: Reviewed & tested by the community » Fixed

> What do we need to do to get this committed?

A maintainer ;)

Which I am, as of today.

Committed, thanks for your work.

@G42: If you haven't figured it out yet, I suggest you open a new issue.

jofitz’s picture

Thanks, @Berdir

Status: Fixed » Closed (fixed)

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

heddn’s picture

drupalninja99’s picture

My question is how come this doesn't get pulled in by drush migrate:upgrade? Is there an extra bit of code required to allow this to be discovered by upgrade? For now I have manually copied the d7 migrate yml to my config folder.