Stop and Resume Drupal Solr Indexing Safely

Nothing is lost when you stop

Stop and resume

You can stop indexing at any moment and carry on later. Nothing is lost and nothing is skipped, because Search API marks an item as indexed only after it has been sent to Solr.

  1. Stop it: drush osstop, or Ctrl+C for a run in the terminal.
  2. Do what you needed to do: a deploy, a restart, a quiet hour for the database.
  3. Start it again with the same command, for example drush ost --server=my_solr_server.
drush osstop --server=my_solr_server
drush ost --server=my_solr_server

What happens to each item

  • Already indexed: not taken again.
  • In the round that was running: taken again, unless its worker had already finished.
  • Not reached yet: taken as usual.

drush oss shows the remaining count at any time, stopped or running. Why this works: How it works.

Everyday tasks