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.

  • If you loaded and saved the nodes rather than updating the DB directly you may find these things easier (but a little slower). – Jeremy French May 12 '11 at 15:54

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.

| improve this answer | |

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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