Installing TheMAG with Drush

This method shows how to install Drupal and TheMAG theme from an existing configuration. This method requires Drush 9 . If you already have Drush 8, you can install a site-local Drush 9 by running composer require drush/drush from your Drupal root directory. Otherwise, please refer to Drush documentation page for more information on how to install Drush.

  1. Move the content from the themag_drupal directory to your web root location or to your development environment. Make sure that you copied all the files including hidden files like .htaccess
  2. From the Envato package, unzip and move the configuration/themag_config directory to your Drupal sites/default directory, so the path will be sites/default/themag_config.
  3. Make a copy of sites/default/default.settings.php and name it settings.php.
  4. Edit the sited/default/settings.php and configure the sync directory location to point at themag_config directory. Add this line at the bottom of the settings.php file:
$config_directories['sync'] = 'sites/default/themag_config';
  1. Run tge Drush site:install command:
drush site:install --existing-config --db-url=mysql://db_user:db_pass@localhost/db_name --account-name="demo" --account-pass="demo"

Change the db_user, db_pass, db_host and db_name with your database info. The --account-name will be you Drupal username and the --account-pass your Drupal password. This Drush command will install the Drupal and will import TheMAG configuration.

On production site, and if your account has permission to do so, it's a good idea to move the configuration sync directory outside of the webroot entirely. If you move the directory ouside of your web root, open up your settings.php file and change the sync location to: e.g. $config_directories['sync'] = '../mysite/config/sync';