Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Rebuild a drupal 8 site after fresh pull from git.
# Drop old DB
mysql -uroot -e "DROP DATABASE drupal8"
# Create new DB
mysqladmin -uroot create drupal8
# Add permissions
mysql -uroot -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal8.* TO 'drupal8'@'localhost' IDENTIFIED BY 'password'"
# Tidy up site files
sudo chmod a+w ~/Sites/drupal/sites/default
sudo rm -rf ~/Sites/drupal/sites/default/files
rm ~/Sites/drupal/sites/default/settings.php
# Create settings.php
chmod a+w ~/Sites/drupal/sites/default
mkdir ~/Sites/drupal/sites/default/files
chmod a+w ~/Sites/drupal/sites/default/files
cp ~/Sites/drupal/sites/default/default.settings.php ~/Sites/drupal/sites/default/settings.php
chmod a+w ~/Sites/drupal/sites/default/settings.php
# Site install
sudo -u _www drush si standard --account-name=admin --account-pass=password --db-url=mysql://drupal8:password@
sudo chmod -R 777 ./sites/default/files
sudo -u _www drush en simpletest -y
sudo -u _www drush dis overlay -y
sudo chmod -R 777 ./sites/default/settings.php
sudo chmod -R 644 ./sites/default/settings.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment