Switching from custom installation profile to lightning on existing drupal sites

In one of my recent client project, we had the requirement to move to lightning profile from custom installation profile, so that they would be able to use the lightning features OOTB. During the POC we found different approaches of using/consuming the lightning features, but we planned to use the lightning extend approach.

In Drupal7, there was pretty easy way to do was to update the install_profile variable

$ drush vset --exact -y install_profile standard

There is an alternate way of doing this is directly is updating the variable name directly in the schema.

In Drupal8, there was not any module that allows to switch the profile like in Drupal 7 there's the profile_switcher module. 

In Drupal 8, the installation profile information has been moved from config to key value store

drush sqlq "DELETE FROM key_value WHERE collection='system.schema' and name='lightning'"
drush sqlq "INSERT INTO key_value (collection, name, value) VALUES ('system.schema', 'lightning', X'733A343A2238303036223B');"

Note: For the second query, The value column data should contain your lightning release information.So use the appropriate information of profile as per your codebase.The above command contains the information of lightning-8.x-2.02

Now, Enable the lightning profile.

drush cset core.extension module.lightning 0

Here the list of things that should be taken care before switching the profile on existing Drupal site:

  • All the enabled modules should be present in the new installation profile, if the modules would not be there then there would be issues come up
  • Do the clear the cache

Related Issues:

  1. https://www.drupal.org/node/2841724

Next article:  Switching to Features from Configuration Management