1

I have a production site like www.example.com and I use 2 subdomains test.example.com and stage.example com for testing and staging purposes. Each of these 3 versions of the site uses it's own database. The user and password is the same for all 3 databases, but of course the database names differs. I have checked and double checked that the correct database names are set in the settings.php file for the 3 sites, respectively.

Nevertheless, when I do a content change in one of these 3 site versions, that same change becomes immediately visible in all 3 sites.

I have tried to turn off all my caching modules, like Boost and Memcache and Content.

EDITED: I have now narrowed it down to a caching problem. If I flush all cache in the site that shows the wrong content, it reverts to the right content. So content changes ends up in the right database. But as I said, even though I have all caching turned off, and all caching modules are disabled, all content changes in one site are immediately reflected in the 2 other sites (until I flush all cache in these 2 other sites).

Does anyone have an idea about where to look? Some common caching in the server environment?

1 Answer 1

1

What you're describing can happen when you link several sites up to the same cache system, but give the same prefix for each of them in settings.php (or don't provide a prefix at all, which is essentially the same thing).

I'm not 100% sure, but disabling the memcache module might not stop it being used if you're declaring its use in settings.php, which you most likely will be.

It might not be the cause, but it definitely could result in exactly the situation you find yourself in. Check settings.php in each of the sites, and see what the state of those prefixes are. If this is the problem, providing different prefixes for each site will fix it straight away.

4
  • Thanks for your answer. I assume this means that I will have to add the prefix to all tables in the database? That also mean that I cannot use a copy of the production database for testing purposes, e.g. after adding a module?
    – TBJ
    Nov 10, 2016 at 16:26
  • No it's the prefix for the cache backend, e.g. drupal.stackexchange.com/questions/56722/…. Without a/with the same prefix all sites read from the one set of data, and multiple Drupal sites will inevitably share many of the same cache keys. Each time your clear the cache all sites will get the data from the site you just cleared the cache for
    – Clive
    Nov 10, 2016 at 17:21
  • Oh my god, that worked! I added a different "memcache_key_prefix" (k1, k2 and k3) for each site in settings-php, and now it works. I owe you bigtime. I have struggled with this for days. Since I disabled the Memcache module, I didn't look further into Memcache. I will be able to complete my move to the new server now. Thanks again!
    – TBJ
    Nov 11, 2016 at 7:28
  • Don't mention it :)
    – Clive
    Nov 11, 2016 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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