Skip to content

Instantly share code, notes, and snippets.

@onecooltaco
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save onecooltaco/a58c29f07b9903adcb33 to your computer and use it in GitHub Desktop.

Select an option

Save onecooltaco/a58c29f07b9903adcb33 to your computer and use it in GitHub Desktop.
Update Drupal by patch file
# download a copy of current version and new updated drupal software.
drush dl drupal-<<original verion>>
drush dl drupal-<<new version>>
# Use diff to create a patch of directories.
diff -urN drupal-<<original verion>> drupal-<<new version>> > drupal-<<orig>>-to-<<new>>.patch
# Use patch to apply the patch from the Drupal site root directory. Patch reads from standard imput.
# Using –dry-run here does not apply the changes, just tells us what it would change. Do this first for testing.
cd /path/to/drupal/root
patch -p1 --dry-run < /path/to/drupal-<<orig>>-to-<<new>>.patch
# The -p1 option removes the top level part of the file path from each file that's listed in the patch.
# This is necessary because the files were originally in seperate directories.
# If all looks good here, run it.
patch -p1 < /path/to/drupal-6.20-to-6.22.patch
# Run Update on the Database
cd /path/to/drupal/root
drush updatedb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment