I have a bunch of aliases in my url_alias table. I want to change the source of certain rows, but I'm not sure if it would affect anything. What I need to know is if the column PID in the url_alias table is linked to anything else. Currently I just want to switch node/33 to node/2343, but im afraid I might break something if im doing it via phpmyadmin. I can't do it via the site as I have over 100+ entries I have to modify. The easiest way is by doing it in mysql.

Also is there a drupal database table map I can generate that shows me how each table is linked to each other?enter image description here

1 Answer 1


Doing any manual updates to the Drupal database is a bad idea unless you know exactly what you are doing.

The {url_alias} table is written to with path_save(). If you look at the source, two hooks may be fired, depending on whether the path is new or update: hook_path_insert() or hook_path_update().

So, if you update {url_alias} manually, you don't give any other modules the chance to react via the hooks. Whether or not anything bad will happen depends on whether your system has any of these hooks in use. Off the top of my head, I am unaware of any modules that do, but you would need to run a module_implements('path_insert') and module_implements('path_update') to be sure.

Your safest bet is to always use the API. Write a standalone script, and execute it with drush -u 1 scr yourscrpt.php to make sure all of your hooks execute.

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.