Is there any effort to add an update function to move all redirects created in the Drupal 6 version of Path Redirect into the new redirect module table?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geerlingguy’s picture

For one of my sites, I only had 4 saved redirects, so I simply copied and pasted them... but for a few sites, there are over a thousand... plus about 10-20,000 shorturls, etc. It'd be awesome if this module could have a working upgrade path from all the modules it's subsuming into D7.

Dave Reid’s picture

It's planned, but just not done yet.

geerlingguy’s picture

K. sounds good.

Dave Reid’s picture

Title: Upgrade from D6 of path_redirect? » Add path_redirect to redirect migration path
Status: Active » Needs review
FileSize
4.76 KB

Initial database table migration, still haven't migrated variables, so test and use at own risk (and make backups).

slashrsm’s picture

MIgration worked OK for my case. The only issue I had was connected with removal of path_redirect. Before migration I did not disable path_redirect and since migration removes path_redirect table site stopped working after upgrade.

Maybe we could leave path_redirect table as it was. It would be removed when one would uninstall Path redirect module anyway.

joelstein’s picture

Status: Needs review » Reviewed & tested by the community

#4 works for me. I see no need to keep the path_redirect table around. I also don't see any need to keep those old update scripts around (redirect_update_1–redirect_update_5). Regardless, the patch worked great. Thanks!

joelstein’s picture

Just want to say that this update still works. Tried it in conjunction with 7.x-1.0-beta2 and everything is still swell.

Dave Reid’s picture

Yeah I realized I should have added this into rc2, but it'll get in the next release, whatever it is.

jwilson3’s picture

Subscribe. It's odd that the dev branch is older than the beta2 release... must be pending some big feature being pushed up? I'll admit im not up to speed on the d.o project release and dev branch workflow anymore since moving to git, but it seemed strange that this wasn't already committed and available in the -dev branch.

antiorario’s picture

Patch in #4 still works from latest dev (from May 18).

rickmanelius’s picture

@Dave Reid
You mentioned this would be rolled into the next release, but cited rc2. Does that mean it's in already in the dev branch? Or will it have to wait for a fully released next update?

joelstein’s picture

I don't see it in DEV... it hasn't been committed yet.

rickmanelius’s picture

@joelstein.
Yup. Still not in dev. But others have tested the patch, if you're in a hurry. I'm about to test myself. I'll let you know what I find.

rickmanelius’s picture

Actually, as per #4, variables haven't been fully ported, so this might require a little extra attention.

Dane Powell’s picture

Priority: Normal » Major
Status: Reviewed & tested by the community » Needs work

sub... as mentioned, it sounds like this patch is not complete (doesn't port variables), so marking as 'needs work'. Also marking as 'major', since many, if not most, of Redirect's users are probably coming from a 6.x install.

Phiper’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 995844-redirect-migrate-path-redirect.patch, failed testing.

Sutharsan’s picture

Patch in #4 still works with latest dev (2011-Jul-28). As I moved from Path Redirect to Redirect module, It was not clear to me that after enabling the Redirect module I must run update.php. Perhaps something to mention in the documentation (Readme or project page).

Dane Powell’s picture

Good point... perhaps we should actually run the conversion in hook_install, not hook_update_n...

rootwork’s picture

Status: Needs work » Reviewed & tested by the community

Is there any progress in getting this patch rolled into a new version? I was disappointed in updating a D6 site that the path_redirect tables still aren't getting migrated. It worked just fine once I applied this patch. As others have reviewed it positively as well, I'm marking it as RTBC.

Dane Powell’s picture

Status: Reviewed & tested by the community » Needs work

Please see #14 and #15- the patch is not complete, as it does not port variables... it may work for some users but won't work for everyone.

Dave Reid’s picture

.

geerlingguy’s picture

That patch will need some rewriting, as the update schema is using single digit numbers for updates now; but the functionality still works for moving all the redirects to the new {redirect} table.

iamEAP’s picture

Status: Needs work » Needs review
FileSize
5.43 KB

re #18-19

These are good points. Because we're not updating the module's schema (which is what hook_update_N()s are for anyway), this should actually just be a function called within hook_install if the path_redirect table happens to exist.

This would require writing #4 as a proper batch operation, which I don't have time for.

In the meantime, I'm attaching a patch that just builds on #4 by adding variable porting code and a line to get rid of the old path_redirect entry in the system table.

hedac’s picture

thank you very much #24 works very nice for me.
One of the things that was preventing me for upgrading to drupal 7 was this issue. Now solved.

JohnAlbin’s picture

Patch in #24 works for <50 path redirect paths. Thanks!

jlea9378’s picture

Patch worked for me. I got an Internal Server Error when the updates finished running, but I think it was a fluke. All 60 records in the path_redirect table were properly migrated to the redirect table.

iamEAP’s picture

Status: Needs review » Reviewed & tested by the community

I'll also note that I used #24 to migrate a little over 3000 redirects. Given that and the above three comments, I'm marking RTBC.

okokokok’s picture

Just imported 852 redirects. All working fine.
I already had 7 existing redirects which were retained as well.

RTBC.

Cynthia Ewer’s picture

Patch worked perfectly, migrated 847 redirects. Marking RTBC.

drupalninja99’s picture

#24 Works great for me!

rootwork’s picture

This has been marked as RTBC since May -- any chance we could get it committed soon? Or are there specific tests we could help run to make it commit-worthy?

Jaza’s picture

#24 works perfectly for me, too. Agreed with above - this is ready to go. Commit, please!

PROMES’s picture

#24 works perfectly for me, too. 698 redirects converted. Please commit!

mry4n’s picture

This appears to have worked for me, too: "migrated 65 redirects".

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Ok I committed #24 with some code split-ups for migrating an individual redirect and migrating the variables to 7.x-1.x. Thank you so much iamEAP for helping with this issue!

http://drupalcode.org/project/redirect.git/commit/f82894d

rootwork’s picture

Hurrah!

Stolzenhain’s picture

Good work! Been looking forward to this after manually migrating a page of redirects and frowning upon future database-conversions for some of our larger sites.

Status: Fixed » Closed (fixed)

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

WeRockYourWeb.com’s picture

Would someone mind explaining how the migration process works now? Do we leave path_redirect (6.x) installed, update to D7 and the latest -dev release of redirect module, and the migration happens automatically?

PROMES’s picture

You better never leave a module of an older version installed. Just disable path-redirect before the upgrade, but don't uninstall (because this will delete the database table).
Upgrade to D7 and enable redirect. Redirect will pick up the path-redirect database table and convert the content to the redirect table.

zkrebs’s picture

#42 - I did this, and it did not convert.

I still have the path_redirect table in Drupal DB and the Redirect table is empty (sans two I added manually).

What to do? Using the latest -dev.

rootwork’s picture

Status: Closed (fixed) » Active

I'm re-opening this just for slavojzizek's benefit, but I have no opinion (or relevant evidence) on whether this isn't working.

But if it doesn't get re-opened no one will ever respond to slavojzizek...

(slavojzizek if/when your question gets addressed, please re-close)

zkrebs’s picture

Priority: Major » Minor

I changed it to minor. I exported the path redirect table from database, did some simple formatting, then used https://drupal.org/project/path_redirect_import to import it to redirect module. Its not an automated upgrade, but it worked.

AaronBauman’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

As of 7.x-1.0-rc1 this is working fine.

If anyone is still having issues, please provide steps to reproduce on vanilla Drupal

Pere Orga’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes let's put that to fixed again.

Status: Fixed » Closed (fixed)

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

hass’s picture

This upgrade does not work properly!