Skip to content

Instantly share code, notes, and snippets.

@jasperf
Created August 20, 2025 01:45
Show Gist options
  • Select an option

  • Save jasperf/1d37f524a1f0bcb8f5a5d52b6b2dd8b9 to your computer and use it in GitHub Desktop.

Select an option

Save jasperf/1d37f524a1f0bcb8f5a5d52b6b2dd8b9 to your computer and use it in GitHub Desktop.

PrestaShop 1.7.6.5 to 1.7.8.11 Upgrade Plan

Overview

This upgrade plan addresses backup issues caused by over 1 million entries in the ps_guest table. The manual upgrade approach using Git provides better control and avoids the problematic auto-upgrade process.

Environment Setup

  • Git Repository: ssh://git@git.hyperlane.co/site/site.git
  • Current Version: PrestaShop 1.7.6.5
  • Target Version: PrestaShop 1.7.8.11
  • Admin Directory: /kanri/ (custom renamed from /admin/)

Step-by-Step Process

1. Initial Setup

  • Clone production to development environment
  • Verify GitLab git repo gets updated with changes
  • Download PrestaShop 1.7.8.11 to local computer
  • Extract the PrestaShop 1.7.8.11 files locally

2. Git Branch Management

  • Create new git branch: prestashop-1.7.8-upgrade
    git checkout -b prestashop-1.7.8-upgrade
  • Change development server Git branch from master to prestashop-1.7.8-upgrade
  • This prevents overwriting staging and production that use master

3. File Overwriting Strategy

✅ SAFE TO OVERWRITE (tracked in Git)

Core PrestaShop files that should be updated:

  • /app/ - Symfony app core
  • /bin/ - Console scripts
  • /classes/ - Core PHP classes
  • /controllers/ - Core controllers
  • /src/ - Modern Symfony code
  • /js/ - Core JavaScript
  • /localization/ - Country/language data
  • /pdf/ - PDF templates
  • /tools/ - Core tools
  • /vendor/ - Composer dependencies (NEW in 1.7.8)
  • /var/ - Symfony var directory (NEW in 1.7.8)
  • Core files: autoload.php, index.php, init.php, etc.
  • /themes/classic/ - Default theme
  • /themes/_libraries/ - Core theme libraries

❌ DO NOT OVERWRITE (gitignored for good reasons)

Customizations:

  • /modules/ - Custom/paid modules
  • /override/ - Code customizations
  • /themes/ (except classic) - Custom theme

Data:

  • /img/ - Product images, logos
  • /upload/ - Customer uploaded files
  • /cache/ - Generated cache files
  • /download/ - Download files

Configuration:

  • /config/config.inc.php - Database credentials
  • /config/settings.inc.php - Shop settings

Admin folder:

  • /kanri/ - Keep the renamed admin folder

⚠️ SPECIAL HANDLING NEEDED

Admin folder merger:

  • The new 1.7.8.11 has /admin/ directory
  • Merge these core files into existing /kanri/ directory
  • Keep specific admin configurations
  • Update core admin functionality

4. File Updates

  • Overwrite all ✅ directories/files with 1.7.8.11 versions
  • Keep all ❌ directories/files unchanged
  • Manually merge admin files from new /admin/ into existing /kanri/
  • Add new files specific to 1.7.8.11:
    • composer.lock (updated dependencies)
    • phpstan.neon.dist (new file)
    • Files in /install/upgrade/ directory

5. Git Operations

  • Stage all changes:
    git add .
  • Commit changes:
    git commit -m "Upgrade PrestaShop core to 1.7.8.11"
  • Push to GitLab:
    git push origin prestashop-1.7.8-upgrade
  • Changes should automatically sync to development server

6. Server-Side Setup

  • SSH into development server
  • Install new Composer dependencies:
    composer install --no-dev --optimize-autoloader
  • Run database upgrade script:
    php /install/upgrade/upgrade.php

7. Testing Checklist

  • Admin panel (/kanri/) loads and functions correctly
  • Frontend displays properly with custom theme
  • All custom modules work correctly
  • PHP 7.4 compatibility verified
  • Database upgrade completed successfully
  • Order process works end-to-end
  • Payment modules function correctly
  • Search functionality works
  • Performance is acceptable

8. Deployment to Staging/Production

Only after thorough testing:

  • Merge branch to master:
    git checkout master
    git merge prestashop-1.7.8-upgrade
    git push origin master
  • Switch staging server to updated master branch
  • Test staging environment
  • Switch production server to updated master branch

Risk Mitigation

  • Easy rollback: Simply switch Git branch back if issues arise
  • Zero production risk: Testing happens on isolated branch
  • Preserves customizations: Git ignore strategy protects custom files
  • Version control: Complete history of changes tracked

Expected Benefits

  • Resolved backup issues with large ps_guest table
  • Updated security patches and bug fixes
  • Better performance with newer codebase
  • Preparation for future PHP version upgrades

Notes

  • The ps_guest table issue should be resolved in the newer version
  • All custom modules need compatibility verification
  • Custom theme may need minor adjustments
  • Database backup should work properly after upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment