My team inherited a Drupal 7 multi-site installation that was originally built with a custom installation profile and Drush make. I have all these sites running correctly in our environment now and want to bring an additional Drupal 7 standalone instance we support under this new multi-site configuration. I copied the database and created a corresponding subdirectory in the sites tree along with the proper edits to the sites.php file. The site does appear correctly when tested in a browser but the modules visible to the other instances are not seen by this site. Those modules are located under the profiles tree. I don't expect to need to use the install profile again and am inclined to copy the profiles/myprofile/modules directory contents to sites/all/modules to address this situation but am concerned about potential database dependencies. What is the best way to clean this up and have all multi-site instances aware of the same common modules?
1 Answer
Quick way...Run
variable_set('install_profile', 'name_of_custom_install_profile');
drupal_flush_all_caches();
from somewhere in the new site.
That'll trick your new site into thinking it was installed with the custom profile, and it should start checking that folder for contrib modules.
-
I added this code to settings.php in the new site directory and received the following error upon refresh: Fatal error: Call to undefined function db_merge() in /Sites/drupal7/prod_multi/includes/bootstrap.inc on line 999– WuWeiCommented Sep 14, 2012 at 18:24
-
Yeah settings.php won't work as it's included too early on in the bootstrap...the DB functions aren't loaded yet. Either install the Devel module and run the code at /devel/php, or put it in a module hook or your theme's template.php file– Clive ♦Commented Sep 14, 2012 at 18:27
-
Is this something I need to execute one time only or does it need to remain in the code?– WuWeiCommented Sep 14, 2012 at 18:29
-
-
Executing via devel module did the trick. Thanks! Note that there is a typo in the second line of your code. I will accept this answer.– WuWeiCommented Sep 14, 2012 at 18:35