Quick and fast method for D7 by using Pathauto 7.x-1.2, VBO 7.x-3.0 and Admin Views 7.x-1.0:

  • drush dl views_bulk_operations
  • drush en views_bulk_operations
  • drush dl admin_views
  • drush en admin_views

Go to /admin/content, edit the view with contextual menu on top right of view.

Then Click the "Bulk operations: Content" field. Then click the "Update node alias" checkbox and save.

Go back to /admin/content and select all nodes

Choose an operation, then select "Update node alias", then execute!

===================

Although pathauto in 6.x-1.x provides a utility to "bulk generate paths", this one-off action fails on thousands of nodes, and does no "batch" processing.
This results in timeouts, memory overruns, and failure. (Pathauto token generation can be expensive, and becomes painful over thousands of nodes)

This "batch" issue is being addressed in 6.x-2.x & 7.x

Until then, you still have an alternative, and it's better!
The pathauto 6.x-1.x module already exposes the pathauto path-rebuilding function as a node operation that can be applied through the content management screen, or if using "Views Bulk Operations" - as a bulk operation there.

This means you will be able to select only and all nodes of a desired content type, and do them all in a "batch" mode without processing overruns.

Get Views Bulk Operations

See the project itself for install and configuration options.

Once enabled, a new action "Update URL alias" becomes available as an available action within VBO. (when editing the view, and the Style: Bulk Operations settings)
You will want to turn that on.

At the same time, ensure that VBO will use "batch mode" ( To execute operations: "Use Batch API" )

Once that is on, the update task will show up on the VBO screen, and you can, for example, choose to regenerate updated alias paths for 3000 'Article' type nodes without doing the same for 15000 'Image' type nodes.

Advanced usage

The global pathauto settings do not allow for any extra logic, though sometimes you want to do different things to different content (especially if working with bulk imported content, or re-architecting)

You can set the pathauto settings to aggressively discard or overwrite any existing paths, then trigger the bulk update over a selection of pages you have defined through VBO. (ones you really need to rewrite)
After that you can change the global pathauto settings to just 'update' or 'leave existing aliases' for other content from then on. Or vice versa or something else.
Without VBO, you could do one or the other of these updates, but not both.
It takes a few more steps, but it's possible.

Comments

oo7_golden_1’s picture

This is EXACTLY what I NEEDED to know thank you thank you thank you.

paramnida’s picture

I don't have a contextual menu at the top. Can you help me know how to enable that? I have them on other pages, but not on my /admin/content page for some reason...

paramnida’s picture

I couldn't find the contextual menu, but then I thought maybe I could get to it from the Views interface. So, I went to /admin/structure/views and was able to select the view for /admin/content and update the setting from there. Hope this helps someone else. It took me way too long to figure this out. Ha ha. Oh well.

alice-0-kim’s picture

Just what I needed. Thank you :)

Freightdev’s picture

This doesn't work for me. Any node without an alias (i.e. "Generate automatic URL alias" is unticked and "URL alias" is blank) doesn't get an alias when I run this bulk update.

edward.radau’s picture

This VBO is not as useful as one would hope. It will not create new aliases at will. If 'path' is set to NULL within the object or the auto alias directive is false, etc. it will not do anything about it. It would make better sense for the operation to forcefully generate these settings regardless. The fact that these settings are missing is a good reason why I need to run this Update and create them and have my aliases.

wcweb’s picture

mysql
Use your_drupal_database;
UPDATE `pathauto_state` SET `pathauto` = '1';

Hope this helps someone.

netdreamer’s picture

You are right, this one really forces the update.
But in D7 the table is pathauto_persist, so the right one is:

UPDATE `pathauto_persist` SET `pathauto` = '1';

gcaudle’s picture

For those interested in doing this in D7 without editing the database:
1. The setting for the "update action" in the url alias settings allows you to determine the action you want taken when paths are updated. If you choose "Create a new alias. Leave the existing alias functioning." or
"Create a new alias. Delete the old alias." the bulk action in the standard content view will work.
2. Then you just set the pattern you want in pathauto, and select the content type you wish to update on the content screen, bulk select all displayed on the page, and use the Update Alias bulk action. That will update all the aliases you selected.