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 dexp_menu module if it has it.

  1. cd into sites/all/modules or sites/all/modules/contrib 
  2. rm -rf drupalexp
  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 ..
  8. mv dexp-menu dexp_menu
  9. cd back to root
  10. Send the changes up
    1. git add .
    2. git commit -m"Update the drupalexp module"
    3. git push

E. Update the db_megamenu module if it has it.

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

F. 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

G. Patch wysiwyg module

  1. cd to the sites/all/modules/wysiwyg folder
  2. wget https://git.drupalcode.org/project/wysiwyg/-/merge_requests/7.patch
  3. patch < 7.patch
  4. rm -rf 7.patch
  5. cd back to root
  6. send the changes up
    1. git add .
    2. git commit -m"Patched wysiwyg module"
    3. git push

H. Replace current 7.3x Date module with 7.2x Date module

  1. Delete Date module in code
  2. Download 7.2.x Date module zip https://ftp.drupal.org/files/projects/date-7.x-2.14.zip
  3. Extract Date module
  4. Place Date module folder in the code where the previous Date module was. Make sure it is all lower case.
  5. Send the changes up
    1. git add .
    2. git commit -m"Downgrading Date module to 7.2.x"
    3. git push

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. updb and cache clear (using terminus or on site)

J. Test

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

K. 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

L. 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

M. 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

N. Send it up

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

O. 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

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