Updates & Upgrading
When the author publishes a new version, follow this sequence. The golden rule: backup first, never skip migrations, always smoke-test after.
On this page
Before you start
- Read the update notes β new versions list changes, new environment variables, and breaking changes.
- Backup: database dump +
storage/folder (how). - Note your version: check
"version"inpackage.jsonand save it with your backup. - Update on a test copy first if possible β especially for major upgrades.
Updating a local install
# 1. Stop the dev server (Ctrl+C in its terminal)
# 2. Replace the source with the new version.
# Keep your .env! Copy it aside and back afterwards:
cp .env ~/salex-env-backup
# 3. Extract/copy the new version into the project folder, then restore:
cp ~/salex-env-backup .env
# 4. Refresh dependencies, client, schema:
npm install
npm run db:generate
npm run db:deploy
# 5. Start again:
npm run devβ Success: the server starts cleanly and the post-update tests below pass.
Updating a production server
cd /var/www/salex
cp .env ~/env-backup-$(date +%F)
# bring in the new code (upload or git pull), then:
cp ~/env-backup-$(date +%F) .env
npm install
npm run db:generate
npm run db:deploy
npm run build
pm2 restart salexdb:deploy is the only migration command for production. It applies pending migrations in order and is safe to re-run. If the update notes mention new seed scripts, run exactly the ones listed β nothing else.Downtime is typically 10β60 seconds (the restart). For near-zero downtime, build first, then restart β pm2 makes the swap quick.
Post-update tests
- Homepage and a product page render; images load.
- Admin login works; dashboard loads.
- One test checkout with your payment provider's test/sandbox mode.
- Order appears in Admin β Orders with correct shipping charge snapshot.
- Vendor dashboard opens and shows its orders (multi-vendor check).
- Check
pm2 logs salex --lines 50for new errors.
If something breaks
- Stop:
pm2 stop salex. - Restore the previous source version (keep the same .env unless notes say otherwise).
npm install && npm run build && pm2 restart salex.- If migrations were applied and must be reverted, restore the database backup from before the update β do not hand-edit migration tables.
- Report the error text to the author's support with your environment details (names only, never secrets).