Manual Upgrade Guide

For when the in-app upgrade UI isn't an option — minimal-tools, SSH-based path.

The recommended path is Admin → System Updates → Upload upgrade package — it handles snapshot, maintenance mode, file extraction, migrations, and rollback automatically. Use this manual procedure only if you can't reach the admin panel, prefer scripted deploys, or are recovering from a botched upgrade.

What gets touched / what doesn't

An upgrade replaces source files but preserves your runtime data. These paths are never overwritten by an upgrade:

Steps

  1. Back up the database required

    Even though the in-app upgrader takes a snapshot automatically, manual upgrades won't — so dump first.

    mysqldump -u DB_USER -p DB_NAME > backup-pre-upgrade.sql
    
    # Or, if you don't have mysqldump installed:
    mysql -u DB_USER -p -e "SHOW TABLES" DB_NAME
    # ...then back up each table by exporting it through phpMyAdmin or similar.
  2. Back up the file tree required

    cd /path/to/Payment_Processor/..
    tar -czf payment-processor-backup-$(date +%Y%m%d).tar.gz Payment_Processor/
  3. Put the site into maintenance mode recommended

    Stops in-flight payment callbacks from being processed mid-deploy. The bootstrap checks for this file and shows a 503 "we'll be back" page to all non-admin traffic.

    echo '{"from":"current","to":"new"}' > storage/.maintenance
  4. Upload the new release

    Unzip the release alongside the current install, then sync everything except the preserve list:

    unzip payment-processor-vX.Y.Z.zip
    rsync -av --delete \
      --exclude='.env' \
      --exclude='storage' \
      --exclude='uploads' \
      --exclude='public/uploads' \
      --exclude='config/license.php' \
      payment-processor-vX.Y.Z/ /path/to/Payment_Processor/

    If you don't have rsync, you can use cp -R followed by manual deletion of removed files — but rsync's --delete handles file removals correctly so old code doesn't linger.

  5. Run pending migrations

    cd /path/to/Payment_Processor
    php bin/migrate.php --status     # show what will run
    php bin/migrate.php              # apply pending migrations
    If a migration fails partway, MySQL implicitly commits DDL — meaning the schema is partially altered and you'll need to restore the database from the dump in step 1. The migrator prints the failing file and exits non-zero; do NOT proceed with the rest of the upgrade until you've reverted.
  6. Bump the installed-version marker

    cat > storage/.installed <<'EOF'
    {
        "version": "X.Y.Z",
        "updated_at": "2026-05-29T00:00:00Z"
    }
    EOF

    This file gates the in-app installer and tells the admin UI which version is live.

  7. Drop maintenance mode

    rm storage/.maintenance
  8. Reset opcache (if enabled)

    If you have OPcache turned on (recommended for production), it'll still hold the old PHP files in memory until its TTL expires. Force a refresh:

    # Easiest: reload PHP-FPM
    sudo systemctl reload php8.4-fpm
    
    # Or hit a one-shot reset URL in the browser (run once, then delete):
    echo '<?php opcache_reset(); echo "OK"; ?>' > public/_reset.php
    # Open https://your-domain/_reset.php in a browser → outputs "OK"
    rm public/_reset.php
  9. Smoke-test

    • Log into the admin panel.
    • Check the version shown on Admin → System Updates matches the target.
    • Open Pending migrations — should say "Database is up to date."
    • Run a test transaction (test-mode gateway) end to end.
    • Tail storage/logs/$(date +%Y/%m/%Y-%m-%d).log for any new errors.
    All green? You're done. Keep the backups from steps 1–2 for at least a week before deleting.

Rollback procedure

If something looks wrong after the upgrade and you need to revert:

# 1. Enter maintenance mode
echo '{}' > storage/.maintenance

# 2. Restore files from the tarball
cd /path/to/Payment_Processor/..
rm -rf Payment_Processor.broken
mv Payment_Processor Payment_Processor.broken
tar -xzf payment-processor-backup-YYYYMMDD.tar.gz

# 3. Restore the database from the dump
mysql -u DB_USER -p DB_NAME < backup-pre-upgrade.sql

# 4. Drop maintenance mode
rm Payment_Processor/storage/.maintenance

Help: this guide is local

This file ships inside the release zip at public/upgrade.html and is also reachable in your browser at https://your-domain/upgrade.html after install. The canonical, machine-readable changelog is CHANGELOG.md at the project root.