I have a multi-site Drupal installation that's misconfigured. The settings information has been confused, and I need to map databases to particular sites. I am tasked with cleaning up the mess.

For any given database from a Drupal installation, what tables can I look at to see which site was using it?

3 Answers 3


Big giveaways will be in the variable table, especially the two rows with the names:

  • site_mail
  • site_name

As hopefully these are different for each one of your sites.

Perhaps this database query can help you:

SELECT * from variable WHERE name LIKE 'site_%';
  • If you have shell access and Drush, you can also run $ drush status from each site's root directory to see which database it uses. I'm not sure if this helps with multi-sites
    – Timmah
    Dec 21, 2015 at 0:55

Drupal doesn't save any reference to the domain name in the database.
If the value you set for the site mail, or the site name is different for each domain of the multi-site, then you can look at the content of the "variable" table: The rows for those values are "site_mail" and "site_name."


Though also not a foolproof method, the URLs on images and other uses of Insert will sometimes end up with absolute paths w/ domain name.

On Drupal 7 you can try

FROM field_data_body
WHERE body_value LIKE 'http%'

On Drupal 6, you can try

FROM node_revisions
WHERE body LIKE 'http%'

Then look at the results.

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.