Prestashop Upgrade Toolbox Audit
ASecurityAudit a legacy PrestaShop shop (1.6 or 1.7) before migrating it to PrestaShop 9, starting with a reference copy running locally. Use when the user wants to start a migration (the first questions, the dossier), audit an old shop (core files, overrides, modules, theme, data, integrations, direct scripts, multistore and markets, scheduled jobs, accounting and legal perimeter, cutover and performance baseline), run a legacy shop on modern PHP/MySQL (MAMP or Docker), debug one that fails there (50...
- 6 stars
- 0 votes
- 0 copies
- 0 views
- Added December 1, 2026
Works with
Security analysis
100/100Pro scans all 13 files and shows the line behind each finding
npx -y skills add PrestaShopCorp/PrestaShop-Upgrade-Toolbox --skill prestashop-upgrade-toolbox-audit --agent claude-codeAre you the author of Prestashop Upgrade Toolbox Audit?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/prestashopcorp-prestashop-upgrade-toolbox-audit)---
name: prestashop-upgrade-toolbox-audit
description: >
Audit a legacy PrestaShop shop (1.6 or 1.7) before migrating it to PrestaShop 9, starting with
a reference copy running locally. Use when the user wants to start a migration (the first
questions, the dossier), audit an old shop (core files, overrides, modules, theme, data,
integrations, direct scripts, multistore and markets, scheduled jobs, accounting and legal
perimeter, cutover and performance baseline), run a legacy shop on modern PHP/MySQL (MAMP or
Docker), debug one that fails there (504/FastCGI timeout, blank page, mcrypt removed in PHP 7.2,
Smarty cache, nginx ignoring .htaccess, MySQL 8 caching_sha2_password), inventory the SEO URLs
while production is live, or decide between an in-place upgrade and a clean reinstall with the
data carried over. Covers phases 0 to 2 and ends at the decision. NOT for moving the data
(prestashop-upgrade-toolbox-data), the modules' port (prestashop-upgrade-toolbox-modules),
verifying or going live (prestashop-upgrade-toolbox-integrity), or installing a brand-new shop.
---
# Legacy audit and the migration decision (phases 0–2)
Shared context, conventions and the containment rule: **`prestashop-upgrade-toolbox-core`**. Read it
first — including `references/version-facts.md`, which holds the version-pinned facts this phase
leans on (what actually breaks a 1.6 on modern PHP, and what the generated `.htaccess` contains).
**Dossier:** write as you go in `migration/00-audit.md` (`prestashop-upgrade-toolbox-core`, "The
migration dossier"). What a reader must know goes in the audit's report,
`migration/audit-report.html`, which the person follows the audit on: laid out when phase 2
starts, one section written as each workstream closes, the points that matter most in
`page/summary.html` (the dossier's page shows them too). It takes the place of
`page/00-audit.html`. Tell the person where the report is when it is first written.
This skill ends at a **decision**, not at a migration. Its output is a documented
recommendation — in-place upgrade, or fresh install of the target with the data carried over —
that someone else could disagree with on the evidence.
## How to run every workstream — mandatory
Follow these steps for **each** workstream of Phase 2, one workstream at a time. They are not
advice. An audit once skipped them: it ran the commands, reported most workstreams "done" from
counts, and every decisive finding turned out to be in the part it had not read.
1. **Size it and tell the user before starting** — number of items (files, overrides, modules,
tables, jobs), lines of code, estimated time, and how the work will be split. Never shrink the
scope silently to fit a session: if it does not fit, say so and split.
2. **Run the measurement commands** of the playbook. Their output makes the workstream
*measured*. It does not make it *done*.
3. **Write a card for every item that is not vanilla** — third-party and custom modules,
overrides, modified core files, custom scripts. Native modules left untouched get one line each
in a single table (name · active · hooked · fate), not a card. Read yourself every item that
touches money, stock, legal obligations or security; delegate the rest to parallel reviewers
with this exact card and the containment rules (read-only, no request to production or third
parties, no secret copied). The card:
- **Role** — what it does for the business, in concrete terms;
- **What changed vs vanilla** — read from the diff, method by method or block by block;
- **Still used?** — used / probably dead / dead, **with evidence** (route or hook active, data
written recently, callers found);
- **Data touched** — tables and columns, custom ones first;
- **External dependencies** — third parties, hard-coded IDs, URLs, groups, VAT rates;
- **Fate on the target** — native (name it) / module + hook / CMS or theme / drop (+301);
- **Effort and risk** — S (< 1 day), M (1–3), L (> 3); what breaks if it is forgotten;
- **Questions for the merchant**.
Inside a card, **every finding** — a business rule, a condition, a hard-coded ID or URL, a third
party, a dead branch, a security issue — is written so the merchant can decide whether to keep
that bespoke development, without opening the code:
- **Where** — `file:line`;
- **Excerpt** — the 1 to 6 exact lines of code, with the condition as written (for a change
against vanilla or a module: before and after). A secret or personal datum is replaced by
`<SECRET>`; never copy its value;
- **Effect for the customer** — what they see or what changes, with every ID resolved from the
database (“category <id> = <name>”, “product <id> = inactive”);
- **Decision to take** — keep as is / rebuild differently (say how on the target) / drop, with
its cost S/M/L.
A finding stated without its excerpt (“IDs are hard-coded in the cart”) is not a finding: the
merchant cannot weigh it. Dead files can stay grouped in a table (file | evidence it is dead).
4. **Check the workstream's "Done when" box** at the end of its section in the playbook. Every line
must be true.
5. **Re-verify, yourself, every delegated claim** that changes a decision or goes to the merchant
(security finding, accounting anomaly, "dead" verdict on something with business weight), in
the code or the database. Write down what you corrected.
6. **Only then write "done"** — in the journal and in every summary.
Never:
- write "done" for a workstream whose items were counted but not read — write
**"measured — analysis pending"** and list what is missing;
- start the next workstream without telling the user the real state of the current one;
- publish a figure you have not re-measured yourself, including a reviewer's;
- size core or override changes with `diff -w` and a line count — use `scripts/core-diff.py` and
`scripts/override-map.py` (see A and B in the playbook);
- leave a wrong figure uncorrected where it was published: correct it there, visibly.
Always, for the whole audit (phases 0–2):
- **Record every workaround applied to the reference copy WITH its consequence for the audit** —
not only what was done, but what it makes false or unmeasurable locally. A table imported
without its data silently changes behaviour (vouchers no longer combine as in production when
their combination table is empty); a module or connector switched off, a domain rewritten, a
setting changed to make a page load — each one goes in the journal as *workaround → what can no
longer be trusted or measured locally*. The audit only **observes**: it changes the copy only
to make it run or to contain it, never to fix the shop.
- **When a later finding contradicts an entry already published, correct that entry where it is**
(journal, synthesis, report, local setup notes) — dated, with the old statement left visible as
wrong. An entry that was true when written and became false afterwards is still a false
statement in front of the reader. Before closing a phase, re-read the entries of the earlier
phases against everything learnt since.
- **Before calling the audit done, prove its coverage and have it attacked.** Run
`scripts/coverage-check.py` over the shop tree and every report (add the database tables and
configuration keys with `--items`): each `UNCITED=` line is an item no report mentions — analyse
it or exclude it in writing until the status is `covered`. Then have it **attacked**: by default
one independent reviewer working through the eight angles of the playbook's checklist
("Contradictory review"); one reviewer per angle only on a stated trigger — multistore, several
markets, heavy custom code. An audit read workstream by workstream looks complete from the
inside; what nobody looked at only shows up when somebody is asked to find it.
## Phase 0 — Preparation
- **Start with the intake** when there is no dossier yet (`prestashop-upgrade-toolbox-core`,
`references/intake.md`): read the version and the perimeter from the shop's files, confirm them
in one summary, ask only what no file holds, create the dossier and draft the request to the
host. The heavier path of this skill fires only on the trigger the intake wrote.
- **Back up first, and prove the backup.** Files and database dumps, copied off the machine.
A backup you have not restored is a hypothesis.
- **Put the code under git**, code only: exclude images, dumps, secrets, personal-data exports
and caches. Set `core.fileMode false` — a legacy shop is full of permission noise, and
committing mode changes buries the real diff.
- **Read what the merchant's team already wrote.** A `docs/` folder, READMEs, a patch log, an
architecture diagram, release notes: they name the systems the code does not show and the local
patches nobody will mention. Read them before any workstream starts, and list every system
**outside the repository** they or the code refer to — a VPN-only script folder, a separate
back-office application, a media server, an ERP-side job. Each one gets a line in the audit,
even if it is out of scope: out of scope is a decision, not an omission.
- **State of the shop:** version, disk footprint, themes present, module count, database size,
PHP version. Measure each one; do not read them off an earlier document.
- **Check what the export left out.** The settings file, the server rewrite file and the user
content directories (`img/`, `upload/`, `download/`) are routinely excluded from a code export.
Ask for the settings file with its secrets redacted **except the cookie keys**, which carry
every customer password; without them the reference copy runs on new keys and no customer login
can be tested.
- **Treat "anonymised" as a claim.** A dump delivered as anonymised usually covers the customer
and address tables and misses the peripheral ones (support threads, newsletter, marketplace
orders, employees). Sweep it before relying on it — the method is in
`prestashop-upgrade-toolbox-integrity` (`references/access-and-data-checks.md`).
- **Pin and archive the release archives now.** Download the exact archive of every version the
upgrade chain will cross, and the exact version of the upgrade tool, and keep them with the
project. Releases stop being distributed and a newer tool can refuse an older step: a chain that
cannot be re-run is a cutover that cannot be rehearsed.
- **Launch the lead-time actions.** Some answers take weeks and sit on the critical path, so they
are asked during the audit, not when the step arrives — the intake asked the first ones; each
goes in the requests table of `00-audit.md`, with who it was asked to and when:
- each **ERP, logistics or marketplace vendor**: is there a version for the target, at what cost,
and is there a test environment?
- each **payment provider**: sandbox credentials and the module for the target;
- the vendors of the **commercial modules** in scope (workstream C);
- **search-engine and analytics access**, for the SEO baseline;
- the **target hosting**: PHP and database versions, who operates it (workstream K);
- the **production crontab**, from the host (workstream I);
- **several weeks of production access logs**, from the host (workstream I): they are
the only list of what third parties actually call — feeds, direct scripts, module endpoints —
as opposed to what people remember. A weekly caller needs a window of at least two weeks.
## Phase 1 — A reference copy running locally
The most treacherous phase, and the one where the schedule slips. Order:
1. import the dumps → 2. **apply containment** (`prestashop-upgrade-toolbox-core`) and prove it →
3. work through the failures → 4. verify over HTTP, then **under concurrency**.
Containment is proven, not asserted: write the copy's own registry, `containment-reference.tsv`
in the dossier (template: `prestashop-upgrade-toolbox-core/references/containment-registry.example.tsv`),
from the old shop's modules and the outbound channels found in the code. Then, before the first
page is served and after every fresh import:
`containment_check.py lint` at `STATUS: well-formed`, and
`containment_check.py verify --state contained` on the reference copy's database at
`STATUS: as-declared` (`prestashop-upgrade-toolbox-data/scripts/`). `lint` refuses a registry with no
mail line or no anonymisation line (`privacy`); `verify` reads the mail method and counts the
addresses still outside the reserved domain, so a mail cut that touched zero rows or an
anonymisation that missed the customer table fails instead of passing silently. Each line's
restore step reads `never: reference copy, discarded after the cutover`: this copy is never
switched back on.
The failure catalogue, cause by cause, is in
[references/local-reference-setup.md](references/local-reference-setup.md). Read it before
debugging: most of these look like the same symptom (a slow or blank page) and have unrelated
causes.
> 🔴 Containment comes **before** the first browser page view, not after it — and it covers every
> outbound channel found in the code, not only e-mail: chat webhooks, messaging APIs, help-desk and
> marketing platforms, partner crons. List them from the code; do not stop at the channels a
> checklist names.
> 🔴 **Phase 1 is done only at its criteria** (see Done below) — not when the home page answers.
> Every workaround made to get there is recorded with its consequence for the audit.
> 🔴 **A reference copy that 404s its own images is not a reference copy.** On nginx the
> front-controller fallback is only a third of what PrestaShop's `.htaccess` does: the image and
> web-service rewrites have to be ported too, or workstream D reads a broken theme, the SEO
> inventory is built from a mutilated site, and acceptance later replays destinations that never
> worked. Details in the failure catalogue.
## Phase 2 — The audit
Workstreams A→K plus SEO. Commands and method:
[references/audit-playbook.md](references/audit-playbook.md). A→G read the code and the data; H→K
read the **business** the code runs — markets, operations, accounting, the cutover — and are the
ones a code-only audit misses.
| # | Workstream | Method | Decisive for |
|---|---|---|---|
| A | Modified core files | `diff` against the exact vanilla release | upgrade vs fresh |
| B | Overrides | inventory, portability, and the **subsystems they short-circuit** (whose configuration is dead code) | carry-over effort |
| C | Modules | starting from what **production serves**; automatic triage (native / official / third-party / custom) then focus; name/directory **case** check; vendor, licence and **known vulnerabilities** per module; settings held on the **third party's side**; table prefix written by hand | replace or rewrite |
| D | Theme | the theme **actually served**, then diff against vanilla | new front (`prestashop-upgrade-toolbox-theme`) |
| E | Data **and files** | volumes, custom tables and columns, multi-language, purgeable junk — plus `img/`, `download/`, `upload/`, overridden `mails/`, which no data query sees | ETL plan |
| E′ | Multistore, employees | shops and shop URLs; employee and permission counts | scope, and a decision |
| F | Integrations | payment **actually used**, blog, web service, ERP/stock, feeds and **where each third party reads them** | reconnections |
| G | Directly-callable scripts | root scripts, front controllers outside the dispatcher, debug endpoints | access surfaces |
| H | Multistore & international | what the shops share, per-shop configuration, currencies, taxes and payment per country; what opening one more market involves today | data model + the market-opening baseline |
| I | Operations | scheduled jobs (server crontab with a fate per line, module endpoints), file exchanges, advanced stock management, back-office usage per profile, the team that will execute | rewrite list + process continuity |
| J | Legal & financial | invoice numbering per shop, credit notes, delivery slips, exchange rates, redeemable vouchers, stored value, consent proof, retention | carry-over requirements + reconciliation metrics |
| K | Cutover & performance | performance baseline (local and production), order rate by hour and day, blackout calendar, target hosting as **questions to the host** (advice, never changed by the agent) | freeze window + the "faster" claim |
| — | SEO | URL inventory — **start early**, production is still live | 301 plan |
**Recommended order: core and overrides first.** They decide the most and they are the cheapest
to measure — but not cheap to **analyse**: the override directory of an old shop routinely holds
tens of thousands of lines and rewrites order creation, invoicing, stock and shipping. Apply the
mandatory steps above to each one; a workstream ends at its "Done when" box, not when its
commands have run.
**Lay out the report as phase 2 starts**, before the first workstream:
`dossier.py report --dir migration` writes `audit-report.html` and one skeleton per section in
`page/report/` (`STATUS: unwritten` until the last one is written). A workstream is done when its
"Done when" box is ticked **and** its section is written for a reader; the report is not written
in one go at the end. From then on `dossier.py check --write` keeps the page and the report
current with the files.
## The decision
Criteria and the bias trap: [references/decision-matrix.md](references/decision-matrix.md).
Two rules worth stating up front:
- **Do not build the grid to reach a conclusion you already hold.** Treat the staged in-place
upgrade fairly: its data-migration scripts are tested by their vendor, which is more than can
be said for a bespoke ETL.
- **Carrying over orders and invoices is risk number one** — accounting and legal integrity,
invoice numbering, custom order statuses. Never classify it as "under control" by default.
## Done
- `dossier.py check` at `STATUS: consistent`, with `00-audit` marked done and every gate row proven;
- backups taken and restorable, code in git, the reference copy's containment registry at
`STATUS: well-formed` and `verify --state contained` at `STATUS: as-declared` after the last
import;
- the reference copy answers 200 on the storefront **of every shop in scope** and on the back
office, **serves its product images at their friendly URLs**, and stays stable under a concurrent
burst — or the gap is stated where the status is published;
- every workaround made on the reference copy is listed with its consequence for the audit, and
the entries of earlier phases have been re-read and corrected against later findings;
- release archives and upgrade tool pinned and archived; lead-time questions sent, with their
status tracked;
- every workstream A→K meets its **"Done when" box** in the playbook: every non-vanilla item has
a card, every native module a line,
every figure is re-measurable by a command, delegated claims were re-verified, and none was
reported done from counts;
- every scheduled job and file exchange listed with its fate (I), the accounting perimeter listed
as carry-over requirements (J); the market-opening baseline (H) when the shop sells to several
markets, and the performance baseline with the order-rate profile (K) when the target hosting
changes or the order rate is high — otherwise one line saying why not;
- the filesystem measured too — `<prefix>_image` rows next to the originals on disk, and the image
types to regenerate;
- multistore answered explicitly (in scope, or one shop, in writing);
- employees and permissions counted, so the "re-create or carry over" decision has a number
behind it;
- an SEO URL inventory captured from the **live** shop, and a families file that classifies every
path the outside world knows (playbook, "SEO");
- `scripts/access_surfaces.py` at `STATUS: inventoried` on the production access logs and
crontabs: every surface a third party calls without a page has an owner, a fate and a check
for after the cutover (playbook, workstream I);
- a written recommendation with its reasoning, and the counter-argument written down;
- a **requests to the merchant** document — the requests section of the end-of-audit report —
separating what pre-exists the migration from what it causes (see the playbook's Output
section);
- the **end-of-audit report**, `migration/audit-report.html`, at `STATUS: reported` from
`dossier.py report --dir migration`: every section written, none left as its skeleton
(playbook, "The end-of-audit report").
- the team's own documentation read in phase 0, and every system outside the repository listed
with its fate;
- `scripts/coverage-check.py` at `STATUS: covered` (or each remaining item excluded in writing),
and the contradictory review run (eight angles), its blockers carried into the reports;
- the configuration inventoried by script — keys grouped by module, keys that hold state, keys
that hold IDs (playbook, "Configuration inventory");
- the baselines captured while the old front still runs (playbook, "Baselines");
- production's served fingerprint captured, and compared with the reference copy's: every
difference explained in writing (playbook, "Baselines");
- the hosting questions asked, each answer recorded with its date (playbook, workstream K).
Files in this skill
- SKILL.md
- references/audit-playbook.md
- references/decision-matrix.md
- references/local-reference-setup.md
- scripts/access_surfaces.py
- scripts/core-diff.py
- scripts/coverage-check.py
- scripts/override-map.py
- scripts/php-methods.php
- scripts/served_fingerprint.py
- tests/test_access_surfaces.py
- tests/test_audit_scripts.py
- tests/test_served_fingerprint.py
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.