[multisite:command] Add Command for creating multisite using Drupal console
Problem / motivation
It's really difficult to create multi site with so many configuration and creating the directories for specific sub sites.
Solution
Command should contains most of the config of multisite creation.
Config options:
- --file => create a copy of example.sites.php to sites.php in sites/ directory.
- --site-name => copy the default directory to your site name directory into sites/ directory.
I am currently working on this here:
https://github.com/jludwig/DrupalConsole/tree/command-for-new-multisite
The command seems to work so far.
Sure @jludwig Please assign it to yourself. Also, it would be great if you can share the workflow of multisite command of yours.
@Ashwini7 I haven't figured out how to assign it to myself yet. Here's the --help output for it (without the global options):
Usage:
multisite:new [options] [--] [<sites-subdir>]
Arguments:
sites-subdir Name of directory under 'sites' which should be created.
Options:
--site-uri[=SITE-URI] Site URI to add to sites.php
--copy-install Copies existing site from the default install.
Help:
The multisite:new command assists in setting up new multisite installs by creating the needed subdirectory and files, and can optionally copy an existing 'default' installation
So, if someone wants to just create a directory with a settings.php file they could do:
$ drupal multisite:new files_only
If they wanted to instead copy what was already installed on default and add it to sites.php they could do:
$ drupal multisite:new --site-uri copy-install.localhost --copy-install copy_install
At this point, sites.php will have an entry with copy-install.localhost, and the copy_install directory will have the settings.php from /sites/default and the files directory placed there. If the files directory is located elsewhere, this needs to be handled manually right now.
A related issue is that site install fails when sites.php is present (issue #2333). On my own installs, I've scripted site:install to move sites.php out of the way before executing site:install. multisite:new currently detects and uses as the base for sites.php if the actual sites.php is not present, but I don't want to include that in the pull request until figuring out what will be the actual solution to #2333.
Pull request: #2335
@Ashwini7 does this fulfill your need?
@jludwig Great work! I haven't tested yet. I am hospitalized facing some medical problem. I will look into once I am back to work. Feel free to resolve this issue. If you think issue has been addressed in your PR.
Thanks!
@jludwig Great work! I haven't tested yet. I am hospitalized facing some medical problem. I will look into once I am back to work. Feel free to resolve this issue. If you think issue has been addressed in your PR.
Thanks!
I believe this feature already checked in to drupal-console long back. Hence, closing this issue.