A little background: our site was Wordpress & vBulletin and some glue to make Wordpress articles link to forum threads.
We've moved to Drupal and managed to migrate in all the Wordpress articles, but didn't manage to get the old urls to migrate in.
However, I created a cck field and stored the old url for each imported article in that cck field.

Here's the question: how can I take the value in the cck field of each of these articles and (after some cleanup), add them to each imported node as an additional alias?

I could attempt to set up pathauto to use the url pattern of the old articles, but I'm not entirely sure I've got that pattern right. So I'd prefer to add the actual old urls.
(By the way, the reason I want the old urls working is that the vBulletin forum archive still contains links to them).

So what's the best way to do this? Would there be a mysql method maybe? I'm not averse to doing something with queries if I can figure out what query to use (I don't really "know" mysql).

Comments

matt_harrold’s picture

If you have Tokens and PathAuto installed (both are contributed modules) you can set up a path for your content type, Tokens will pass the CCK value for you, and PathAuto can "bulk create" the aliases for you. Problem solved.

aharown07’s picture

Thanks. That does sound like it should work. I do have tokens.... and the affected nodes are all of the same special content type, too so no worries about messing up other nodes.
Will be giving this a go fairly soon.

aharown07’s picture

Actually, there's a couple of problems with doing it that way.
One, the bulk create function only applies aliases to nodes that don't already have them. But the delete aliases function is not content-type specific, so I'd have to delete and recreate *all of my content aliases.
That may become necessary, but I'm nervous about that.

I wonder how hard it would be to remove aliases for just that one content type (via the db)... or maybe via Views Bulk Operations. Will check that out.