Problem/motivation

In Drupal 6, install profiles were entirely 'run once', there was no runtime code execution at all, so once you'd installed Drupal it didn't really matter which install profile you used. This was fine for sites that just installed 'Drupal' and then built on top of it. It was a pain for distribution maintainers since they weren't able to cleanly run updates etc.

In Drupal 7, install profiles got the ability to implement hooks in .module files and .install, as well as .info support. This makes them nearly but not quite modules.

There are several issues around Drupal 7 install profiles in the queue. While the Drupal 7 change fixed some problems, it fixed some others which are impossible to solve in Drupal 7 cleanly, however we should try to sort it out for Drupal 8.

The main thing I'm concerned with in this issue is that install profiles have become a required/hidden contrib module, and this is entirely enforced by core. This means if you install Drupal 7 with one profile, and it is never updated to Drupal 8, you either have to hack around it manually, or you're stuck.

People are already running into bugs when they upgrade from Drupal 6 sites that used install profiles that aren't being used for D7 - which makes sense since a lot of D6 install profiles were one-offs.

Proposed solution

I'm mixing a few things in here, some might need to be split into sub-tasks:

* Get rid of the custom .profile extension and just use .module
* Add a 'type' key to .info files so we can identify install profiles other than by extension (or if not rely on profiles/$profile/$profile.module as a naming scheme.
* Show the profile in the modules interface like any other (or worst case have a separate install profile admin screen like we do for themes)
* Allow Drupal to work without any install profile in the system - so if you disable/uninstall the profile your site can continue to run normally.

There are some other bits to this but that'll do for now.

UI changes

There will need to be a place to disable install profiles, unless we hide the feature and require drush to do it (that might be OK for a first pass actually).

API changes

This will definitely involve at least some API changes for install profiles themselves.

Comments

catch’s picture

Title: Allow install profiles to be disabled » Allow install profiles to be uninstalled
KarenS’s picture

+1 on this, I have been bitten when upgrading from a Drupal 6 site that was originally created with a custom install profile that does not and will not exist in Drupal 7. There is no way to upgrade without errors if the system has a value in the install profile name variable and there is no way to uninstall the install profile other than to manually alter the variable.

KarenS’s picture

I will also note that many of the people reporting these errors originally created sites using the Acquia distribution, so there are quite a few of them. In some cases they were just using the distribution as an easy way to get started and had no intention of being permanently tied to it. In some cases they don't even realize they are tied to it ("I *think* I might have used the Acquia installation").

catch’s picture

I added a patch at #1170362-89: Install profile is disabled for lots of different reasons and core doesn't allow for that that makes core stop spitting errors when the install profile is disabled.

We should leave this open for a more comprehensive fix (like allowing profiles to be disabled via the UI).

kika’s picture

If already in profiles->modules utopia: can one possibly install several profiles in same time? What are the ux/support consenquences?

Sheldon Rampton’s picture

I'm increasingly of the opinion that there is a significant design flaw embedded in the current concept of "installation profiles."

"Installation" is something that happens once, and only once, when a website is first created. I think it is inherently problematic, therefore, to use installation profiles to both perform initial setup and to provide site configuration after the initial setup has been completed.

Every website that I have ever worked on has required customization after the initial setup. I think it is actually rare and unusual for an installation profile to be able to anticipate all of the ways that a website's owners will want to customize and modify the site after the initial configuration has been completed. Why, then, should installation profiles continue to enforce things like module dependencies? At present, I find myself forced more often than not to hack the code of an installation profile post-installation simply so I can turn off a feature that I don't want.

If I set up a website using the Acquia Commons module, for example, it enables the admin module. However, suppose I prefer to use the admin_menu module instead (which, in fact, I do). Why should I have to edit the installation profile simply so I can make this change?

There are, of course, situations where there are good reasons to want to bundle together configuration settings, but Drupal offers other mechanisms, such as the Features module, for doing so.

David_Rothstein’s picture

If I set up a website using the Acquia Commons module, for example, it enables the admin module. However, suppose I prefer to use the admin_menu module instead (which, in fact, I do). Why should I have to edit the installation profile simply so I can make this change?

Why would you have to edit the installation profile? You can just turn off the module via the user interface.

That said, hiding modules or preventing them from being disabled is certainly something installation profiles can do if they want to (especially in D7), and it's an important feature since it allows them to shape Drupal to behave exactly as they desire - in fact, it's probably the main thing they need to do since any other functionality could be contained in a hidden module rather than implementing runtime hooks in the profile itself (as D7 lets profiles do), but that's another story.

Given that, this issue seems to make sense; it should be possible to turn off an installation profile or switch to a new one via the UI. A challenge here is that any modules that ship with the profile are going to completely disappear as soon as the profile is turned off; somehow we have to deal with that. Also, in line with Sheldon Rampton's comment, "installation profiles" may not be the best term given what these things actually do post-installation... Do we have to use a different term in the user interface ("distribution", or something else?) in order for this to make sense?

Sheldon Rampton’s picture

Hm, it looks like I was mistaken. I was under the impression that modules listed as dependencies[] in an installation profile's .info file could not be turned off unless you first commented out the dependencies[] line in the .info file. I guess I was wrong about that. However, I still think there is some value in trying to separate the "installation" and "profile" parts of "installation profiles."

As I think back now about how I got the idea that module dependencies of installation profiles cannot be turned off, I'm remembering that the project I was working on involved porting an existing Drupal 6 website to Drupal 7 and then trying to convert it to OpenPublic. In order to do so, I created a module based on the installation profile which had a lot of the same dependencies and script steps. I think it was that module which created the dependencies that I could not turn off. However, I would not have had a reason to create that module in the first place if there had been a way to run the OpenPublic installation profile on an already-existing website.

I guess the point I'm getting at is that I think the "installation profile" should be as minimal as possible and should only contain actions that would only be undertaken when initially creating a website. I'm envisioning maybe breaking "installation profiles" as currently designed into two parts: an "installation profile" and a "configuration profile." The "installation profile" would run at the time of installation, but the "configuration profile" could be triggered to run later if desired. Normally the "installation profile" would trigger the "configuration profile," but this would provide more flexibility for people in situations like mine who have already-existing websites where they want to adopt the same configuration.

I can see the value in being able to "uninstall installation profiles," but I think there's also value in making it possible to "install" installation profiles at a moment in time later than the initial site installation.

sun’s picture

Somehow, I disagree with the entire proposed solution. ;)

IMHO, the idea to expose install profiles as modules was a very bad and utterly bogus one in the first place.

The way this is currently implemented is a giant hack. It breaks proper discovery of install profiles, it disallows install profile inheritance, it confuses users in the UI, and lastly it resulted in almost impossible to reproduce bugs.

After diving into this area some more recently, I seriously believe we should revert that entire design to the one of D6- and created a separate bug report for that:
#1676196: Install profiles are registered as modules

ohthehugemanatee’s picture

I just wrote a blog post on how to go from an install profile to vanilla drupal. It's a good place to start if you're trying to get out of a relatively simple install profile.

Here's a big +1 to the profile improvements coming in 8. :)

sonicthoughts’s picture

#10 was very helpful. I'm sure this is a common scenario.

natts’s picture

Following from #10, the Profile Switcher module is now available for switching install profiles in D7: https://www.drupal.org/project/profile_switcher

mitokens’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

catch’s picture

Title: Allow install profiles to be uninstalled » Allow install profiles to be switched
Version: 8.9.x-dev » 9.3.x-dev

Bumping this again.

We can't rely on install profiles existing in perpetuity - they go unsupported the same as modules.

So we should allow for the case where someone needs to switch from one install profile to another.

There's a contrib project that provides this, but API support in core would be a start.

https://www.drupal.org/project/profile_switcher

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

donquixote’s picture

I think install profiles are still a weird concept.

#6 (Sheldon Rampton, 12 years ago)

I'm increasingly of the opinion that there is a significant design flaw embedded in the current concept of "installation profiles."

"Installation" is something that happens once, and only once, when a website is first created. I think it is inherently problematic, therefore, to use installation profiles to both perform initial setup and to provide site configuration after the initial setup has been completed.

There is also the scenario where a team works on a project without sharing a database dump.
Perhaps during an early phase of development, or there are other reasons.

Such teams will currently run into the problem where install from existing config does not work if the profile contains a hook_install(). See #2982052: Allow an install hook in profiles installing from configuration.

donquixote’s picture

For my taste, after initial installation, the concept of an install profile seems quite useless.

The main purpose of an install profile is to guide the initial installation, and (what currently doesn't work so well), additional non-configuration setup when installing from existing config.

An install profile _can_ be a container for modules and themes in a distribution.
However, I don't really see a benefit from this: It turns a distribution into an island or prison, instead of something you can grow out of.

I support this issue and the one I linked above, but long term maybe we should rethink this concept.

catch’s picture

Status: Active » Postponed

@donquixote you should check out the recipes initiative which is trying to do exactly this.

I think we can postpone this issue on #1170362: Install profile is disabled for lots of different reasons and core doesn't allow for that - not convinced there's any benefit to switching to a new install profile, if you can uninstall one instead.