I was wondering if there is any more info about the proper way to do multi-sites with Backdrop. I've done them with Drupal 7. I know there is now a top level files folder so this has changed but how much else. I've read the files in the sites folder but they don't really provide much info. Without trying to experiment a lot, I don't know how similar or different the multi-site processing is between D7 and Backdrop.

I gave up on D8 for a multitude of reasons and I'm really hopeful that we can use Backdrop. I really like your philosophy and the target audience you are trying to serve. As a small business, I need to spend more time on my business then I do on my web site. Thanks for helping with that!

Accepted answer

Hi @ and welcome!

I've read the files in the sites folder but they don't really provide much info. 

Hm, it sounds like this is something we should improve.

I don't know how similar or different the multi-site processing is between D7 and Backdrop.

In general, not much has changed. The one (maybe only) change is that the "magic" domain name matching has been removed. It's now *required* that you list your site's domain name -- and the folder its files will live in -- in the sites.php file.

Here's a copy of one my sites.php files:

$sites['examplesite.com'] = 'examplesite1';
$sites['examplesite.biz']   = 'examplesite2';

Once you've done that, it should be business as usual if you are familiar with Drupal 7's multi-site set up!

I usually put site-specific modules, themes, layouts, and files in the directories specified in sites.php, but I *also* move my configuration files outside my web root (instead of leaving them inside the files directory).

For my sites, I also change the location of my config files in each sub-sites settings.php file, so it looks something like this for examplesite1/examplesite.com:

$config_directories['active'] = '/var/www/examplesite.com/config/examplesite1/live-active';
$config_directories['staging'] = '/var/www/examplesite.com/config/examplesite1/staging';

... and like this for examplesite2/examplesize.biz:

$config_directories['active'] = '/var/www/examplesite.com/config/examplesite2/live-active';
$config_directories['staging'] = '/var/www/examplesite.com/config/examplesite2/staging';

These config changes are optional, but I find that I like to have all my config organized just like my sub-sites directories, for sanity :)

Comments

drop's picture

Hi @ and welcome!

I've read the files in the sites folder but they don't really provide much info. 

Hm, it sounds like this is something we should improve.

I don't know how similar or different the multi-site processing is between D7 and Backdrop.

In general, not much has changed. The one (maybe only) change is that the "magic" domain name matching has been removed. It's now *required* that you list your site's domain name -- and the folder its files will live in -- in the sites.php file.

Here's a copy of one my sites.php files:

$sites['examplesite.com'] = 'examplesite1';
$sites['examplesite.biz']   = 'examplesite2';

Once you've done that, it should be business as usual if you are familiar with Drupal 7's multi-site set up!

I usually put site-specific modules, themes, layouts, and files in the directories specified in sites.php, but I *also* move my configuration files outside my web root (instead of leaving them inside the files directory).

For my sites, I also change the location of my config files in each sub-sites settings.php file, so it looks something like this for examplesite1/examplesite.com:

$config_directories['active'] = '/var/www/examplesite.com/config/examplesite1/live-active';
$config_directories['staging'] = '/var/www/examplesite.com/config/examplesite1/staging';

... and like this for examplesite2/examplesize.biz:

$config_directories['active'] = '/var/www/examplesite.com/config/examplesite2/live-active';
$config_directories['staging'] = '/var/www/examplesite.com/config/examplesite2/staging';

These config changes are optional, but I find that I like to have all my config organized just like my sub-sites directories, for sanity :)

I got the multi-site working the way I wanted it to based on your info. Thanks!