Skip to content

Instantly share code, notes, and snippets.

Last active April 25, 2017 17:18
What would you like to do?
Drupal 8 reinstall site script
cd drupal
sudo rm -fr vendor
composer install
sudo chmod 777 sites/default
cd sites/default
rm -fr settings.php services.yml
# for developers only (sets up some dev mode settings, do this before install!)
cp ../example.settings.local.php ./settings.local.php
# for everyone
cp default.settings.php settings.php
cp services.yml
chmod 0666 settings.php services.yml
sudo rm -fr files
mkdir files
sudo chown keopx:www-data files # NB this is server/user specific!
chmod 0775 files
# Add local env setup
echo 'Set local settings file before install'.
sed -i 's/# if (file_exists/if (file_exists/' settings.php
sed -i 's/# include $app_root/ include $app_root/' settings.php
sed -i 's/# }/}/' settings.php
sed -i 's/# $settings/$settings/' settings.local.php
drush si standard --db-url=mysql://drupal8_contrib:drupal8_contrib@mysql/drupal8_contrib --site-name="drupal test" --account-name=root --account-pass=root -y
drush en admin_toolbar admin_toolbar_tools -y
drush cr
drush en admin_toolbar admin_toolbar_tools -y
drush cr
echo 'Done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment