0

Many words have been renamed in the node using the below code:

update node set title = replace(title,'Apple','Orange')
update node_revisions set title = replace(title,'Apple','Orange');

But now I need to know how to update the path aliases using the MySQL command line; using the Drupal administration interface is very tiring, for thousands nodes.

1
  • If you loaded and saved the nodes rather than updating the DB directly you may find these things easier (but a little slower). May 12, 2011 at 15:54

2 Answers 2

1

I don't think you will have much success using mysql, the quickest way is likely to write a script that bootstraps drupal, loads each node and then saves the node, I think this should update the aliases.

1

You can find this interesting, it's the source of the pathauto_nodeapi().

When you update a node, the function pathauto_node_update_alias($node, 'update'); is called and update the path accordingly.

If you dig up into the source code, you'll reach the sql but as @user1258 says, it's not a very good practice to bypass the api and going directly through the db.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.