D7 Upgrade to PHP 8.2

Here are the steps for upgrading our D7 sites to PHP-8.2.

A. Create a multi-dev called php82. Clone from the live environment.

B. Git pull and git checkout php82 

  1. If you get an "aborting" message when you do git pull run the command git stash and then try git pull again. 

C. Ensure the php82 multi-dev core and modules are up to date by looking at admin>status report and admin>modules>update.

  1. If updates are needed, use D7 update instructions.
  2. git pull again after.

D. Update the drupalexp module

  1. cd into sites/all/modules or sites/all/modules/contrib 
  2. rm -rf dexp_menu
  3. git clone git@gitlab.com:watech-web/dexp-menu.git
  4. cd dexp-menu
  5. ls -la
  6. rm -rf file or folder that starts with .git
  7. cd back to root
  8. Send the changes up
    1. git add .
    2. git commit -m"Update the drupalexp module"
    3. git push

E. Update drupalexp theme to drupalexp-php81

  1. cd to the sites/all/themes folder
  2. rm -rf drupalexp
  3. git clone git@gitlab.com:watech-web/drupalexp-php81.git
  4. mv drupalexp-php81 drupalexp
  5. cd drupalexp
  6. rm -rf .git to remove the git file
  7. cd back to root
  8. send the changes up
    1. git add .
    2. git commit -m"Update drupalexp theme to drupalexp-php81"
    3. git push

F. updb and cache clear (using terminus or on site)

G. Change the PHP version in the pantheon.yml file to 8.2 and save

H Send it up

  1. git add .
  2. git commit -m"php 8.2"
  3. git push

I. Test

  1. Status report
  2. Recent log
  3. Visually look around the site
  4. Edit and save a page and review recent log messages

J. IF you get a responsive_tables_filter error

  1. In site root:
    1. git clone git@gitlab.com:watech-web/d7-php8-patches.git
  2. ls
    1. You should see d7-php8-patches 
  3. cd sites/all/modules/responsive_tables_filter
    1. or cd sites/all/modules/contrib/repsonsive_tables_filter
  4. patch < ../../../../d7-php8-patches/responsive_tables_filter/responsive_table_filter_php82.patch 
    1. or patch < ../../../../../d7-php8-patches/responsive_tables_filter/responsive_table_filter_php82.patch
  5. In site root
    1. rm -rf d7-php8-patches
  6. Send it up
    1. git add .
    2. git commit -m"patching responsive tables filter module"
    3. git push
  7. Here is a list of other patches Dan has placed in the patches folder. You would follow the same process if you have an error regarding these modules.
  • ckeditor
  • drupalexp
  • eck
  • entity_reference_autocomplete
  • features_extra
  • feeds
  • feeds_ex
  • hierarchical_select
  • job_scheduler
  • multiupload_filefield_widget
  • oauth
  • path_breadcrumbs
  • responsive_tables_filter
  • security_review
  • tb_megamenu
  • workbench_moderation
  1. updb and clear cache

K. IF you get date errors

  1. Switch to SFTP on pantheon dashboard
  2. In site root:
    1. terminus drush 'sitename'.php82 -- dl date-7.x-2.14
    2. Respond to the prompt
  3. Commit changes on dashboard
  4. Switch back to git mode
  5. updb and clear cache

L. Other errors: Patch as required

  1. Troubleshoot the issue and find a patch
  2. cd into the module folder causing the problem
  3. wget urltopatch
  4. patch < nameofpatchfile
  5. rm -rf nameofpatchfile
  6. cd to root

M. Send it up

  1. git add .
  2. git commit -m"patching ____ module"
  3. git push
  4. updb and clear cache

N. Test again

  1. Status report
  2. Recent log
  3. Visually look around the site
  4. Edit and save a page and review recent log messages

O. Update spreadsheet with "php82 ready 'date' 'initials'"