Upgrade Arc CMS
Your site or app is a copy of the Arc CMS repository, so an upgrade is a git merge of the newer Arc CMS into it. When your copy has not edited any core file, the merge is clean.
Once: add Arc CMS as the upstream remote
git remote add upstream https://github.com/quadralyst/arccms.git
git fetch upstream
A copy made as on Install has it already. npm run check:core needs this remote: without it, it checks nothing and fails, so it never passes by accident.
Every upgrade
-
Check that no core file changed, with your work committed:
npm run check:coreIt must report that no Arc CMS core file changed. If it lists core files, move those changes into the custom space first (Keep core untouched), or the merge will conflict with them. A site's own home page, templates, static pages and partials belong in
src/custom/site/. A copy made before that folder existed has them inpublic/, listed as core: merge anyway, then move them withnpm run arc:own-site(Move your site into src/custom/site). -
Read what changed in
CHANGELOG.mdof the new version, and look for any step it asks of an app. -
Merge the new version:
git fetch upstreamgit merge upstream/mainA copy that follows the
devbranch mergesupstream/devinstead;npm run check:corenames the branch your copy follows. -
Install the dependencies of the app and of the functions:
npm installnpm install --prefix functions -
Run the tests:
npm run test -- --runIf your app has rules of its own, or the new version changed the rules, run the rules tests too:
npm run test:rules -
Redeploy everything. A new version can add or change functions, rules, indexes and the website, so pick "Everything" in the guided deploy:
npm run deployA deploy of all the functions also deletes those the new version no longer has. It lists them and asks first. See Deploy.
What a clean upgrade looks like
- The merge has no conflicts, and none of your custom files changed: Arc CMS ships them once, empty, and never changes them again.
npm run check:corestill reports no core file changed. Your custom and install files are counted, not flagged.- The tests pass, and the deploy ends with
Done:.
When the merge conflicts
- In a core file: your copy edited it. Take the new version's file, then make your change in the custom space. If the custom space cannot do it, the change belongs in Arc CMS as a general feature: see Core and custom.
- In
public/: your copy edited the website in Arc CMS's files. Runnpm run arc:own-site, thennpm run arc:own-site -- --write: it moves your edits intosrc/custom/site/and settles these conflicts (Move your site into src/custom/site). - In
src/environments/environment.ts,environment.prod.tsorarc-install.ts: your copy filled them in, and the update that made Arc CMS ship them with no project emptied them. Keep your own version of each (git checkout --ours <file>). Arc CMS never changes their values again; when it adds a key,CHANGELOG.mdnames it: add only that key. - In
package.jsonorfunctions/package.json: your app added a dependency. Keep both sides' entries, then run the two installs above to rewrite the lock files.
Functions deployed without the arccms- prefix
Every Arc CMS function deploys as arccms- followed by its name. A project that still has Arc CMS functions under their plain names moves over once with npm run arc:upgrade. It deletes every deployed function that has an Arc CMS function name and is not in the arccms codebase, then deploys the arccms functions. See what it would delete first, and check that the list holds no function of another app with the same name:
npm run arc:upgrade -- --project=default --dry-run
Then run it without --dry-run at a quiet time: for a few minutes, database events are not handled. Straight afterwards:
Deploy the website. The previous website calls the old function names, which no longer exist.
Register the webhooks again at their new addresses,
arccms-dodoWebhookandarccms-handleEmailWebhook. Until then, the payment and email providers' events are lost.Republish the static pages, so their search box calls
arccms-search:npm run seed:dev, ornpm run seed:prodfor theproductionalias.Send one test email and make one test checkout.
Links in emails sent before the move (open tracking, links that go through the old functions) stop working.