Skip to main content
16 votes
Accepted

Programmatically get current multi-site instance name

Thanks to @Clive for telling me about DrupalKernel::findSitePath which takes the current $request to then return the path of the matching multi-site directory. And thanks to @4k4 for the tip that ...
leymannx's user avatar
  • 18.3k
9 votes
Accepted

Deprecate multisite in 8.x for removal in 9.x

You have a few questions there, so I'll hit them individually: How serious is deprecation in 8.x and removal plan of multi-site in drupal 9? the topic is in category of plan for two years. It's ...
Jaypan's user avatar
  • 17.7k
7 votes
Accepted

Are shared user tables still supported and working?

Don't. Per table-sharing is a relict of the past, deprecated and will be removed in Drupal 9. With all the layers on top that dynamically create tables for fields, cache invalidation and so on, this ...
Berdir's user avatar
  • 83.3k
5 votes

How do you use 'drush site-install' to install a multisite with separate databases using a single command?

In the link you provided, @greg_1_anderson mentioned using --sites-subdir. This option is used to create a site folder under <DRUPAL_ROOT>/sites/. For example, if you run drush si --sites-...
Jimmy Ko's user avatar
  • 2,871
5 votes
Accepted

How can I override the node template for one multi-site instance?

I once had a question on how to get current multi-site instance name. You can use the accepted answer's code to add another template suggestion based on the name then: /** * Implements ...
leymannx's user avatar
  • 18.3k
4 votes
Accepted

How can I replace drush @sites?

Waiting something similar, I wrote this small script I called "drall" you may adapt: #!/usr/bin/php <?php // Path to sites.php file. include('web/sites/sites.php'); $done = []; $argv = $_SERVER['...
Oulalahakabu's user avatar
  • 1,313
3 votes

Installing / updating modules in multi-site environment

You have described the options for multisite pretty well: Lots of shared code by putting modules in /modules Lots of copies of module code by moving to /sites/[sitename]/modules but only one copy of ...
acrosman's user avatar
  • 2,728
3 votes
Accepted

Fixing Multi-site files path

You may be aware of this. Change file path for individual sites at Configuration/Media/File system. By default it is set to sites/default/files. So your both sites are addressing same path. So just ...
CodeNext's user avatar
  • 3,729
3 votes
Accepted

How do I add a site to a multi-site

You have the sites.php file in the wrong spot, it should be at sites/sites.php, it should not be inside any of the site directories, such as sites/original2.com/sites.php.
sonfd's user avatar
  • 7,945
3 votes

Different content, one database

Yes it is possible. Use the Domain module. But if the sites will not share any data, no special modules are needed. Set a unique “Table name prefix” when installing Drupal on each site instance.
mona lisa's user avatar
  • 6,022
2 votes

What happens when multiple context conditions match?

Context starts from top and moves downward on all your created contexts and will stop on the first one to trigger it. This is why your context A is being displayed. You have a few options... Set a ...
jsidigital's user avatar
2 votes
Accepted

How do I specify a parent domain in a multi-site install?

It is called multi-site aliasing, hence the results. Drupal offers you to server multiple domains from the same folder in order to preserve the paths in the database. So you would use the same folder ...
nhck's user avatar
  • 156
2 votes
Accepted

background-image and sites.php

It sounds like you're confusing hostnames with file system paths. The array mapping in sites.php is: Hostname => Instance Folder So taking your example, requests for http://mysite.example....
Clive's user avatar
  • 167k
2 votes
Accepted

Convert two existing sites to multisite

Yes. Configure an apache virtual host for each site. They look something like this: <VirtualHost *:80> DocumentRoot "/path/to/drupal/install" ServerName mysite.example.com </...
mona lisa's user avatar
  • 6,022
2 votes

How to split content for different target audience?

@max I am assuming that since there is a 1-1 relation between 'private' and 'business' content, you are probably just hiding (restricting) content in on of the two. So if for example, your 'private' ...
JP Dippenaar's user avatar
2 votes
Accepted

Multisite files folders

Verify your configuration at admin/config/media/file-system on the multisites. "Public file system path" may be configured to sites/default/files.
mona lisa's user avatar
  • 6,022
2 votes

Multiple sites and performance in Drupal 7

My recommendation is to go with a multisite. Multiple Drupal instances and multisite are about the same in terms of performance (multiple databases). One Drupal instance will not scale as well and ...
mikeytown2's user avatar
  • 8,322
2 votes
Accepted

Share nodes and users across multiple sites

Sharing users can be done by setting up OpenAuth or something like it. Sharing nodes can be done using views database connector this tool will let you pull data from a table in another database. To ...
Daniel Lefebvre's user avatar
2 votes
Accepted

How do I create a site inside another one?

It's possible, but usually not really recommended solution - as we have subdomains/multisites in Drupal. But basicly only thing that will probably need small adjustments is .htaccess, make sure to ...
Szymon Jankowski's user avatar
2 votes

Adding new website as multiwebsite under existing drupal website

Domain modules will be your best bet. It will allow you to use same codebase and database for all your sites. You will also have an option to push content to a specific site if need be. The Domain ...
Ash U's user avatar
  • 389
2 votes
Accepted

Unable to choose an installation profile on a multi-site installation

In the .info.yml file, do no put distribution statement, ss mentioned in this guide: # Optional: Declare your installation profile as a distribution # This will make the installer auto-select this ...
Kartagis's user avatar
  • 610
2 votes

Deprecate multisite in 8.x for removal in 9.x

I've used Aegir for multi site management, great tool! If you have ever used Amazon Web Services, it's similar like that but for Drupal. With a click of a button you can launch specific site builds. ...
No Sssweat's user avatar
  • 31.4k
2 votes

How can I replace drush @sites?

I'd simply place a lightweight loop into your ~/.bashrc or ~/.bash_profile or where ever you prefer. Just update the SITES=( foo bar ) array to your needs. Source your bash file, cd into your multi-...
leymannx's user avatar
  • 18.3k
2 votes

How can I replace drush @sites?

An out-of-the-box solution is provided by a package named jigarius/drall. I wrote that package and I've used it on a number of multi site Drupal installations.
Jigarius's user avatar
  • 3,119
2 votes
Accepted

How can I have separate databases for each domain (countries) of my Drupal website?

It is pretty simple to set up a multi-site with a single codebase. You could have the following directory structure (source): -- core -- modules -- contrib -- custom -- themes -- contrib ...
AjitS's user avatar
  • 10.9k
2 votes

How to translate Groups in a multilingual site?

Your question appears to be somehow related to this issue, which is closed and fixed. That issue contains an image which looks like so: So check if the version of the Group module that you're using, ...
Pierre.Vriens's user avatar
2 votes

After upgrading from drush 7 to 8 with multisites, using drush from site directory cannot find drupal 7 (Windows)

It appears that drush 8 does not support drupal projects that were not built with composer. Drush 7 does not have this requirement. I added this composer.json to the drupal 7 root directory: { "...
Dan Chadwick's user avatar
2 votes

Can I still share data tables with multisite, using shared database, in Drupal 8 or do I need to use 'Domains' contrib module?

posting my own answer with a brief explanation... I have investigated the Config Split and Features modules and found that they are not providing what we need for this instance of Drupal running a ...
rwcorbett's user avatar
  • 203
2 votes

How to add file extensions while creating a field (type file) through the module installer.yaml?

Really, that's a task for the Features module. And even if you decide against fully using Features in the end, you could at least use it locally to export your content type and fields and see in the ...
leymannx's user avatar
  • 18.3k
1 vote
Accepted

Multisites with shared files folder – good or bad idea?

This should not work. Managed files should be automatically removed once there are no more entries in the file_usage table for them. I see you say that it's not happening on your setup, but maybe that'...
Wayne Eaker's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible