Drupal distributions offer a simple and elegant way to spin up a site based on features that match your project needs. Over time your project may diverge from the direction of a distribution or a distribution may no longer be supported. In these situations it may be necessary to uninstall the distribution. The following steps can be used to remove a distribution from a Drupal 7 site.
Most distributions reside in the profiles directory of your site.
1. Move modules and themes that you will continue using to their standard location in the sites directory. You can skip the mkdir steps if these directories already exist:
mkdir sites/all/libraries
mv profiles/<distribution>/libraries/* sites/all/libraries
mkdir sites/all/modules/contrib
mkdir sites/all/modules/custom
mv profiles/<distribution>/modules/<distribution>_* sites/all/modules/custom
mv profiles/<distribution>/modules/* sites/all/modules/contrib
mkdir sites/all/themes
mv profiles/<distribution>/themes/* sites/all/themes
2. Search for any paths that are explicitly set by the install file included with your profile:
cd profiles/<distribution>
grep 'profiles/<distribution>' * -R
Your output may look similar to the following (placeholder text would be replaced by real values):
<distribution>.install: variable_set('<variable_name>', 'profiles/<distribution>/libraries/<library_name>');
3. Using drush, set a new path for the variable listed. Repeat for each item returned by the previous step:
Drush vset <variable_name> 'sites/all/libraries/<library_name>'
4. Use drush to update the install profile variable:
drush vset install_profile standard
5. Some additional cleanup may also be required in the database:
drush sqlq "DELETE FROM `system` WHERE filename LIKE 'profiles/<distribution>/<distribution>.profile"
drush sqlq "UPDATE `system` SET status=1 WHERE filename LIKE 'profiles/standard/standard.profile'"
6. Once you have moved the modules and and themes to their new locations, rebuild the registry and clear caches:
drush @sites registry_rebuild
drush @sites cc all
You may need to install registry_rebuild on one of your environments. To do this use the following command before completing the steps above:
drush7 @none dl registry_rebuild