Skip to content
Back to skills

Prestashop Upgrade Toolbox Data

ASecurity

Carry a legacy PrestaShop shop's data onto PrestaShop 9 once the audit has decided — run the schema-upgrade chain on a disposable clone, transplant the upgraded database into a fresh install, carry the files, and make every later database step replayable. Use when the migration decision is made and the data has to move: products, customers, orders/invoices, CMS pages, configuration, product images; when customer passwords must keep working after the move (the cookie-key lineage); when a versi...

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
developmentrustgophpdockergitdatabase

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add PrestaShopCorp/PrestaShop-Upgrade-Toolbox --skill prestashop-upgrade-toolbox-data --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prestashop Upgrade Toolbox Data?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prestashop Upgrade Toolbox Data
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/prestashopcorp-prestashop-upgrade-toolbox-data/badge)](https://www.skillsdirectory.com/skills/prestashopcorp-prestashop-upgrade-toolbox-data)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: prestashop-upgrade-toolbox-data
description: >
  Carry a legacy PrestaShop shop's data onto PrestaShop 9 once the audit has decided — run the
  schema-upgrade chain on a disposable clone, transplant the upgraded database into a fresh
  install, carry the files, and make every later database step replayable. Use when the migration decision is
  made and the data has to move: products, customers, orders/invoices, CMS pages, configuration,
  product images; when customer passwords must keep working after the move (the cookie-key
  lineage); when a version-upgrade tool reports success without actually upgrading; when a
  rebuild step must be made idempotent and provably replayable. Covers phases 3 and 4. NOT for
  the pre-decision audit (see prestashop-upgrade-toolbox-audit), NOT for the modules (see
  prestashop-upgrade-toolbox-modules), NOT for integrity checks or going live (see
  prestashop-upgrade-toolbox-integrity).
---

# Data carry-over (phases 3–4)

Shared context, topology and conventions: **`prestashop-upgrade-toolbox-core`**. Read it first.

**Dossier:** write as you go in `migration/01-data.md`, and what a reader must know in `migration/page/01-data.html` (`prestashop-upgrade-toolbox-core`, "The migration dossier").

**The source is never modified by this skill.** It reads a dump. That single property is what
makes abandoning cheap right up to the DNS switch.

## Phase 3 — The target

Install a clean target from the official release archive or Docker image, pinned to the exact
version the last hop reaches. Do not improvise a partial install. **Install it without
demo fixtures**: a target seeded with sample products and customers makes every reconciliation
count differ for a reason that has nothing to do with the migration. **Give it a random table
prefix**: the transplant renames the imported tables to it.

What that install is for, and what it is not:

- it provides the **code** — the target version, the target's theme, and no `override/`; the
  modules the audit kept come after the transplant (phase 5);
- it does **not** provide the data. That is the upgraded clone's database, imported whole
  (phase 4) — never copied table by table, which would put new code next to accounting data.

Two things to settle before the target serves a page:

- 🔴 **The cookie key must be the source's, not the installer's.** A legacy shop's customer
  passwords are hashed with the shop's cookie key as salt, so a regenerated key invalidates
  **every** customer account — repairable only by a mass password reset, i.e. an e-mail to the
  entire customer base. Nothing carries it on its own: the transplant copies the three keys
  (`cookie_key`, `cookie_iv`, `new_cookie_key`) from the clone, and the key **PHP resolves** is
  then checked, not the one in the file. See
  [references/landing-the-data.md](references/landing-the-data.md).
- **Apply containment before the target serves a single page**
  (`prestashop-upgrade-toolbox-core/references/scope-containment.md`), from a **registry** that pairs
  every cut with its restore step and a probe of its real state. `scripts/containment_check.py
  lint` refuses a registry that forgets a channel (payment is the usual one), a cut with no
  restore step, or a probe that cannot tell the two states apart; `verify --state contained`
  then reads every state — and a probe that reads **nothing** fails: that is the cut aimed at a
  table or key the target does not have, which touches zero rows and exits 0.

## Phase 4 — The upgrade chain, then the transplant

The data must reach the target's **schema**. Doing that by hand is the expensive mistake: use the
vendor's upgrade tool on a **disposable clone** of the source, version hop by version hop — one
**hop** being one version step the tool actually supports — then transplant its database into
the fresh install.

- The chain, its runtime constraints, the conversion to InnoDB between the hop to 8 and the hop
  to 9, and the post-condition that is not optional:
  [references/upgrade-chain.md](references/upgrade-chain.md).
- `scripts/hop_check.py` — after every hop: nothing lost in the tool's log, the version read from
  the database, a schema probe of the version's own changes ([references/hop-probes.tsv](references/hop-probes.tsv));
  and, before the hop to 9, no table left on MyISAM without a decision.
- The transplant (prefix, backup, three cookie keys, theme), the clean-up after it, the
  cookie-key invariant, marker substitution and the files no database move carries:
  [references/landing-the-data.md](references/landing-the-data.md).
- `scripts/landing_check.py` — the prefix renamed with no table left behind, and no leftover:
  menu entries of absent modules, ghost modules, entities missing a translation or a shop.
- `scripts/check-password-lineage.py` — proves the lineage through the target's own runtime.

> 🔴 **Never trust an exit code as a post-condition.** The upgrade tool can exit 0 meaning
> "you already have this version" while the database stays on the old schema — or after losing
> migration queries it logged as warnings. Chained blindly, that carries an old or half-migrated
> schema forward and calls it the new target. `hop_check.py hop` at `STATUS: migrated` after
> every hop, before the next one.

> 🔴 **The upgrade tool changes the functional perimeter without asking.** It uninstalls what it
> judges incompatible — and a module that computes its compatibility from the running version can
> fall out of range in the middle of the chain, files included; it sets global switches
> (overrides, non-native modules) and moves on; the new version brings modules of its own,
> enabled. All of it exits 0, and every business-data reconciliation stays green. So capture the
> perimeter **before and after every hop** — `capture-sets.py --sets metrics/module-state-sets.tsv`
> (in `prestashop-upgrade-toolbox-integrity`) — and run `state_diff.py compare` on the two captures
> with a decisions file: every module, hook attachment or switch that appeared or disappeared
> needs a written decision and a signature (kept, replaced by what and agreed by whom, dropped).
> An undecided change stops the chain. Which module it hits is never the point: the same
> mechanism takes a payment module on one shop and a carrier on the next.

> 🔴 **The chain upgrades a running shop, not a dump.** Each hop needs a PrestaShop that boots,
> which means its own PHP version — a 1.6 clone will not run on the PHP that runs 9. Plan the
> hops as containers, one runtime per hop, before naming a cutover date.

**Then carry the files.** `img/` (the whole photo library), `download/` (digital products already
sold), `upload/`, and any overridden `mails/` template. No schema upgrade and no table copy
touches them, and every row count stays green without them. Regenerate the image derivatives
afterwards — which only means something if the originals arrived, so measure both
(`prestashop-upgrade-toolbox-integrity`, `metrics/files.tsv`).

## Phase 5 — Modules and overrides

Covered by **`prestashop-upgrade-toolbox-modules`**: inventory, a written decision per module, the port,
the proof — and the ordering rule: modules are installed after the transplant.

## After the transplant — what the shop must still do

The front itself — the old storefront reproduced as a child theme — is `prestashop-upgrade-toolbox-theme`.
Three traps remain here, whatever the theme:

- **Historic URL formats.** If the legacy shop served content at a URL shape the target does not
  produce (a module's own route, an id-in-path article format), those URLs are indexed. Serve them
  from the new front, or redirect them — do not discover this during acceptance. And a redirect
  that lands on the homepage is not a preserved URL, it is a lost one wearing a 301.
- **Rebuild the search index.** `<prefix>_search_index` and `_search_word` arrive empty or stale,
  and a shop whose storefront search returns nothing passes every row count, every configuration
  hash and every HTTP check. It is a replay step, and its post-condition is a non-zero count.
  It is one of seven: missing pages and renamed URLs in `meta`, collations, the faceted search's
  price index, native modules left disabled, mail templates, redirects — the table of
  [references/landing-the-data.md](references/landing-the-data.md), §5, with their order.
- **Everything done here must be replayable from scripts.** At the cutover the database is
  reloaded from a fresh dump, which wipes every by-hand adjustment made in the back office. Any
  state that lives **in the database** — module installs and hooks, CMS content, translations,
  business settings, layered-navigation tables, the search index — has to be re-created by a
  replay step, and that step is only validated **on a freshly reloaded database**. On the one
  where the work was done, its guard conditions are already satisfied: it skips them and looks
  idempotent when it is not.

**Employees and permissions are a decision, not a migration.** `<prefix>_access` went from
per-tab flags in 1.6 to authorization roles in 9, so the two models do not map and nothing can
reconcile them. Decide — re-created (the recommendation: the roles do not translate, and a
migration is the right moment to drop the accounts of people who left) or carried over — write it
down, and let `metrics/access.tsv` prove the replay restored what you validated. An empty
permission table gives every non-SuperAdmin profile a back office with nothing in it, and the
symptom reaches you as "the site is broken".

## Done

- `dossier.py check` at `STATUS: consistent`, with `01-data` marked done and every gate row proven;
- every hop at `hop_check.py hop` `STATUS: migrated` — nothing lost in the log, the version read
  from the database, the schema probes of the version — its log cited in the hop table;
- the clone converted to InnoDB before the hop to 9 (`hop_check.py engines`, `STATUS: innodb`);
- every hop's perimeter compared (`state_diff.py compare`, `STATUS: decided` or `identical`), each
  decision signed;
- the containment registry at `STATUS: well-formed`, and `verify --state contained` at
  `STATUS: as-declared` after every fresh import;
- the transplant done by script — target backed up under a dated name, clone dump kept, prefix
  renamed (`landing_check.py prefix`, `STATUS: renamed`), three cookie keys copied, theme set —
  and the clean-up after it (`landing_check.py leftovers`, `STATUS: clean`);
- `scripts/check-password-lineage.py` passes, including the effective-key and end-to-end checks;
- the files are over — `img/`, `download/`, `upload/`, overridden `mails/` — and the derivatives
  regenerated, both **measured**, not assumed;
- the search index is rebuilt and non-empty;
- the employees/permissions decision is recorded, and the back office opens for a non-SuperAdmin
  profile;
- multistore is either out of scope **in writing** or covered by `metrics/shop.tsv`;
- reconciliation between source and target is clean (`prestashop-upgrade-toolbox-integrity`);
- every rebuild step is a script, replayed once against a freshly reloaded database;
- outbound integrations still contained, and proven to write nothing;
- personal-data and secret sweeps re-run after the final import — they are non-regression
  controls, not one-off passes (`prestashop-upgrade-toolbox-integrity`).

Files in this skill

  • SKILL.md11.2 KB
  • references/hop-probes.tsv1.4 KB
  • references/landing-the-data.md17.1 KB
  • references/upgrade-chain.md13.2 KB
  • scripts/check-password-lineage.py10.3 KB
  • scripts/containment_check.py12.6 KB
  • scripts/hop_check.py13.9 KB
  • scripts/landing_check.py10.9 KB
  • tests/test_check_password_lineage.py6.4 KB
  • tests/test_containment_check.py10.9 KB
  • tests/test_hop_check.py8.6 KB
  • tests/test_landing_check.py6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.