1

Whenever I try to clone one of my sites, I get this error:

Drush command terminated abnormally due to an unrecoverable error.
Error: Cannot redeclare entity_features_get_controller() (previously declared in /data/disk/dd/distro/005/drupal-7.41.1-prod/sites/www.firstsite.com/modules/entity/entity.features.inc:11) in /data/disk/dd/distro/005/drupal-7.41.1-prod/sites/www.clonesite.com/modules/entity/entity.features.inc, line 19

Could you tell me what the reason could be?

1 Answer 1

6

I would recommend that you avoid multisite, and clone the code into a separate codebase -- then copy the database. This is much easier to manage for simple use cases, and would entirely avoid your problem above, as you would only have one copy of each module present in your code base, so Drupal would not be able to load any of them twice.

I am not sure exactly how your situation above came to be, but the database from the original site contains references to all of the paths of all of the enabled modules; somehow, Drupal is trying to bootstrap both the old cached paths, and also the new paths for the same module in its new location. If you want to continue with a multisite setup, it is likely that a registry rebuild would clear this up.

3
  • Hello. I am using Baracuda + Octopus on which i have an Aegir instance. I usually do this without any issue. I tried "drush rr" and cleared caches and did clear registry on my aegir UI. This did not work.
    – yazzou
    Feb 22, 2016 at 1:40
  • Another option would be to move modules like entity to the sites/all folder. As these infrastructure modules are usually very stable and common for many sites. Feb 23, 2016 at 7:37
  • I ran into this - certainly could be a case by case basis, but looks like by manually truncating all cache* tables, I was unblocked Feb 8, 2021 at 21:22

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