2 · Apply the update
Objective — bring the new vendor files into the repo on a branch you can throw away, then merge and migrate — so your live code is never touched until the update is proven safe.
Background
Section titled “Background”The schema diff (step 1) told you what will change. This step makes it happen — reversibly. Two safety nets do the work: a backup tag captured before anything changes, and the branch model where the new release lands on its own author/vY.Y.Y branch, frozen and pristine, before it ever merges into your working code.
That branch model is the spine of the whole vendor-update strategy. Each vendor release gets its own frozen author/vX.X.X branch; your changes live downstream on develop. Merging a new author branch into develop is what surfaces conflicts cleanly — and because your customizations sit in update-safe homes (Workflow 3), there should be almost none.
flowchart TD T["Tag backup<br/>before-vY.Y.Y"] --> A["Branch<br/>author/vY.Y.Y"] A --> U["Drop in new<br/>vendor files"] U --> C["Commit frozen<br/>vendor baseline"] C --> M["Merge into<br/>develop"] M --> R["composer install<br/>+ migrate"]1. Tag a rollback point before anything changes
Section titled “1. Tag a rollback point before anything changes”The cheapest insurance there is. A backup tag is a named save-point — if the update goes wrong, you check it out and you’re back where you started.
-
Create and push a dated backup tag from your current production state.
Terminal window git checkout productiongit pull origin productiongit tag backup-$(date +%Y-%m-%d)-before-vY.Y.Ygit push origin backup-$(date +%Y-%m-%d)-before-vY.Y.Y# Expected: a new tag named backup-<today>-before-vY.Y.Y exists locally and on the remote- ✅ A dated backup tag exists on the remote;
git tag | grep backuplists it.
- ✅ A dated backup tag exists on the remote;
2. Create the frozen author branch
Section titled “2. Create the frozen author branch”Branch off your current frozen baseline and name the new branch for the new version. This is where the vendor files land — kept clean, with none of your customizations, so it stays a true mirror of what the vendor shipped.
-
Create the new author branch for the incoming version.
Terminal window git checkout -b author/vY.Y.Y# Expected: now on branch author/vY.Y.Y, branched from your frozen baseline- ✅
git branch --show-currentprintsauthor/vY.Y.Y.
- ✅
This branch must stay vendor-pure — never commit a customization here. Its only job is to record exactly what the vendor shipped, so future diffs (like the one you just ran) stay honest.
3. Drop in the new vendor files
Section titled “3. Drop in the new vendor files”Replace the tracked vendor files with the new release. The clean way is to un-track everything, unzip the new files over the project, then re-add — so deletions and renames are captured, not just additions.
-
Un-track the current vendor files so the next
git addrecords a true replace.Terminal window git ls-files -z | xargs -0 git update-index --force-remove --# Expected: all tracked files are staged for removal (working files stay on disk)- ✅
git statusshows the tracked tree staged as deleted; your files are still present on disk.
- ✅
-
Unzip the new vendor release over the project root — 👤 with your file manager, overwriting when prompted. Do not use the command line for this.
- ✅ The new vendor files are in place; the version in the vendor’s own version file matches the release you downloaded.
-
Re-add everything and commit the frozen baseline.
Terminal window git add .git commit -m "Import vendor vY.Y.Y"git push origin author/vY.Y.Y# Expected: a single commit capturing the new vendor files as the frozen vY.Y.Y baseline- ✅ One commit records the new baseline; the
author/vY.Y.Ybranch is pushed.
- ✅ One commit records the new baseline; the
4. Merge into develop and migrate
Section titled “4. Merge into develop and migrate”Bring the new baseline down into your working branch, then install dependencies and run migrations. Because your customizations live in update-safe homes, conflicts should be rare — and the few that appear follow one simple rule.
-
Merge the author branch into
develop.Terminal window git checkout developgit merge author/vY.Y.Y# Expected: a clean merge, or conflicts confined to vendor files you deliberately edited- ✅ The merge completes; any conflicts are in known vendor files, not in your
_zajtables or ZajModules.
- ✅ The merge completes; any conflicts are in known vendor files, not in your
-
Resolve conflicts by the golden rule — your changes win in your homes, vendor wins in theirs.
Conflict Resolution New vendor file Accept the vendor version Vendor file you edited Keep your logic; re-apply over the new vendor base A _zajtable or ZajModuleShould never conflict — if it does, your customization strategy leaked into vendor space - ✅ Every conflict is resolved; no
_zajor ZajModule file was in conflict (or you’ve noted why it was).
- ✅ Every conflict is resolved; no
-
Install dependencies, preview, then run migrations.
Terminal window composer installnpm install && npm run buildphp artisan migrate --pretend # preview one more timephp artisan migratephp artisan optimize:clear# Expected: only the changes you classified in step 1 are applied; caches cleared- ✅ Migrations apply exactly the changes you classified earlier; the app boots with
php artisan serve.
- ✅ Migrations apply exactly the changes you classified earlier; the app boots with
Checklist
Section titled “Checklist”Do not mark this step done until every box below is checked.
- 🤖 Backup tagged — a dated
backup-…-before-vY.Y.Ytag exists on the remote (plus a DB dump if a destructive change was flagged). - 🤖 Author branch created — on
author/vY.Y.Y, branched from the frozen baseline. - 🔀 Vendor files imported — 👤 unzipped via file manager; 🤖 committed as one frozen-baseline commit and pushed.
- 🤖 Merged to
develop— merge clean; conflicts confined to known vendor files, none in_zaj/ZajModules. - 🤖 Migrated —
composer install+migrateran; only the classified changes applied; app boots.