0

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.

put on hold as unclear what you're asking by leymannx, Jdrupal, mradcliffe, Yusef, kiamlaluno Nov 14 at 10:51

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Where can I see such a distribution? – anoopjohn Nov 3 at 2:37
  • Can't you use Drupal core's minimal installation profile? – Jdrupal Nov 3 at 8:48
  • How is Umami doing it? – leymannx Nov 3 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 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 at 15:43
-1

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 at 16:49

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