I want to be able to provide a simple way for users to install a Drupal website that contains a certain set of content, contributed modules and custom content types. I also want to keep the process of developing this scenario as simple as possible for the developer.

I know that the standard way to do this would be to create a Distribution such as those that are listed at https://www.drupal.org/project/project_distribution. Another example is the Umami content available in a standard Drupal distribution. However, building a distribution seems to be quite a bit of work and should require a commitment to maintain that distribution if it is listed on the Drupal website. So, my question is whether there is a simpler way to allow users to install a website with some given content without my having to make the effort of building a distribution, since whatever I build will not be listed on the Drupal website.

The thought that there may be an easier way was prompted by my experience with some theme vendors. With some theme vendors, the process of installation involves only creating a database from an included SQL script and then starting the installation wizard and only having to input the database credentials. No other answers need to be answered in the installation wizard. It is almost as easy for the user as installing a distribution, and I am wondering if it may be easier for me as a developer to implement.

When I examine some of these theme installations that use this approach (e.g., News+ lite at https://www.drupal.org/project/newsplus_lite) there is no code in the docroot/profile sub-directory, so this approach cannot be using a standard install profile or distribution because that is where extra content or code would be stored for an install profile or distribution. From my investigations so far about creating Distributions or Installation Profiles, I have not yet read how such an approach would work or be implemented. So, I am asking if anyone knows how such an approach (as utilized in the News+ Lite and other similar installations) works and how I might duplicate it.

  • Where can I see such a distribution? – anoopjohn Nov 3 '19 at 2:37
  • Can't you use Drupal core's minimal installation profile? – user72672 Nov 3 '19 at 8:48
  • How is Umami doing it? – leymannx Nov 3 '19 at 17:42
  • @anoopjohn - I added the News+ Lite theme profile as an example of where this is being used, as well as some more details about specifically how it behaves. Hopefully that makes it more clear. – bkudrle Nov 15 '19 at 15:40
  • @Jdrupal - The minimal installation profile is a good place to start for determining how installation works, but I am trying to add more specific custom content types and specific content as well. Hopefully the revision of the question clarified that to some degree. – bkudrle Nov 15 '19 at 15:43

One of the support staff at MoreThanThemes was kind enough to provide some direction on how they do this. You can see the result in the structure of their free or paid themes. In short, the steps are pretty simple for what might be termed a cloned installation. The steps are basically the following.

  1. Create a clone of the site that you want to install (https://www.youtube.com/watch?v=9NMRwkTzrCM describes that pretty well)
  2. In the clone, overwrite/replace the /docroot/default/settings.php file with the docroot/default/default.settings.php file
  3. Make a clone of the original database (e.g., using MySQLDump, PhpMyAdmin copy or drush sql-dump) and install it in a new database instance that you will use for the cloned site.

If you also have removed the Umami distribution and the minimal distribution from core, then the installation wizard will automatically bypass the choice for which install profile to use. In that case, the installation wizard only asks for the database information, where you will use the information for the cloned database. That will be all you need, and you will have a installed clone of your original website.

From my testing, it looks like the UUID of both sites are the same, just as if you had cloned the original site. So, the main use case from what I can see for this scenario would be if you wanted to share a copy of your site with other people, including the content (like the theme companies do). The only difference from a regular distribution like Umami or OpenAtrium from the user's standpoint is that they have to load the database file on their own before they do the installation. But from a developer's standpoint, this seems to be a much easier approach to sharing a website with the content and should be adequate for many users who want to test out your site.

I am surprised that this is not more widely documented and perhaps I have missed something here. But in my tests so far, this seems to be all that is needed. Hopefully this will help someone else who may need this simpler approach.

  • This is no "installation", this is "deploying". This procedure will copy everything to the new site, including the stuff you sureley do not want to share with third parties, e.g. the complete user data. – Hudri Nov 15 '19 at 16:49
  • I think part of the issue maybe due to nomenclature, especially since there are so many variations for tasks for new paradigms in CMSes. In Drupalize.me, for example, it states "Drupal currently supports the deployment of code and configuration, but not user generated content." (drupalize.me/topic/deployment-workflows). Since the OP described the desire for original content, then a deployment would not be appropriate by this definition. The fact that user data is included is also not an issue since that is supplied with the docs for installation and makes installation easier, IMHO. – bkudrle Nov 21 '19 at 19:45
  • So I still stand by this answer as being a good one for the OP. Still not sure why the OP was so confusing to everyone, though, but would be interested in any clarification on that if it is interesting to anyone. – bkudrle Nov 21 '19 at 19:47
  • Just a clarification also concerning user data, since the major use case is for a demo site (as mentioned in the OP for the theme installation), then the user data should not be an issue. – bkudrle Nov 21 '19 at 19:58

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