Skip to content

Instantly share code, notes, and snippets.

@ainsofs
Last active May 4, 2020 23:15
Show Gist options
  • Save ainsofs/327df51c41abb71a99e2387780825f05 to your computer and use it in GitHub Desktop.
Save ainsofs/327df51c41abb71a99e2387780825f05 to your computer and use it in GitHub Desktop.
Command lines to update Drupal
# ensure you have backed up the database and files before running these commands
# mysql/mariadb
drush sql-dump --gipz --result-file
#postgres
pg_dump -U postgres -h localhost "[YOUR_DATABASE]" | gzip > [dbname]-[date]00.sql.gz
# remove old files
rm -rf images/ includes/ misc/ modules/ profiles/ scripts/ themes/
rm -f .* *.php *.txt *.config
# update with new files
cp -Rf drupal-7.52/* [website root]/
cp -f drupal-7.52/.* [website root]/
# restore backed up files eg
cp ~/backup/.gitignore [website root]/
drush updb
drush updb #yes twice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment