BrixFax Px4

Tableau de Bord

Restore / DR

Disaster recovery and restore checklist for the BrixFax/Px4 Astro + Supabase + Vercel setup. This page does not restore anything by itself. It is a cautious runbook for restoring from the DB, Storage, and code backups.

Golden rule

First restore into a new/test environment. Do not overwrite the working production Supabase project or production Vercel deployment until the restored copy has been tested.

A safe restore test should use:

  • a new or test Supabase project,
  • a test Vercel project or preview deployment,
  • a copied local code folder,
  • test environment variables,
  • no production domain switch until smoke tests pass.

What must be restored

  1. Code: Astro source code from Git, source snapshot, or the SyncBackFree mirror.
  2. Local config: local .env values from the protected/offline copy.
  3. Supabase DB: PostgreSQL schema and data from the DB backup folder.
  4. Supabase Storage: uploaded image/files from the Storage backup folder.
  5. Vercel config: project settings, domains, and environment variables.
  6. Validation: build, deploy, and smoke-test the restored app.

Backup folders involved

DB backup folder example:

C:\Sites\Codex\supabase_backup_YYYY_MM_DD_HH-mm

Expected DB backup files:

  • roles.sql
  • schema.sql
  • data.sql
  • backup_manifest.txt
  • sha256.txt

Storage backup folder example:

C:\Sites\Codex\supabase_storage_backup_YYYY_MM_DD_HH-mm

Expected important Storage bucket:

brixfax-public-images

Code mirror example:

H:\PrimaryBUs\C_Sites

Restore order

  1. Restore/copy the code first.
  2. Install dependencies and confirm the app builds locally.
  3. Create or choose the new/test Supabase project.
  4. Restore the DB backup into the new/test Supabase project.
  5. Create/check the Storage bucket in the new/test Supabase project.
  6. Restore the Storage files into that bucket.
  7. Update local .env to point to the restored/test Supabase project.
  8. Update Vercel environment variables for the restored/test deployment.
  9. Redeploy.
  10. Smoke-test before any production switch.

Step 1: Restore code locally

Use one of these sources:

  • the normal Git working folder,
  • the SyncBackFree mirror,
  • the latest source snapshot as a readable reference.

Example local recovery target:

C:\Sites\my-astro-restored-test

After copying/restoring the code, run:

cd /d C:\Sites\my-astro-restored-test

npm install

npm run build

Step 2: Restore local environment config

Restore or recreate:

C:\Sites\my-astro-restored-test\.env

The restored .env should point to the new/test Supabase project first, not blindly to production.

Do not paste secrets into this web app, source files, ChatGPT, Git commits, or snapshots.

Step 3: Restore Supabase DB

This is a supervised restore operation. Use a new/test Supabase project first. Get the new/test project PostgreSQL connection URI locally from the Supabase Dashboard.

Template restore commands from the DB backup folder:

cd /d C:\Sites\Codex\supabase_backup_YYYY_MM_DD_HH-mm

psql "NEW_SUPABASE_POSTGRES_URI" -v ON_ERROR_STOP=1 -f roles.sql

psql "NEW_SUPABASE_POSTGRES_URI" -v ON_ERROR_STOP=1 -f schema.sql

psql "NEW_SUPABASE_POSTGRES_URI" -v ON_ERROR_STOP=1 -f data.sql

Important: these are restore templates, not commands to run blindly. Review errors carefully. If roles.sql fails because roles already exist or are managed by Supabase, stop and review before continuing.

Step 4: Restore Supabase Storage

First create/check the Storage bucket in the new/test Supabase project:

brixfax-public-images

Then upload/copy the downloaded Storage backup objects into that bucket. Template command from the Storage backup folder:

cd /d C:\Sites\Codex\supabase_storage_backup_YYYY_MM_DD_HH-mm

npx supabase login

npx supabase link

npx supabase storage cp .\storage\brixfax-public-images ss://brixfax-public-images -r --experimental --linked

If asked to choose a project, choose the new/test project first. Do not run this against production until the restore procedure has been tested.

Step 5: Restore Vercel config

In the restored/test Vercel project, check:

  • Git/project link,
  • build command,
  • environment variable names and values,
  • production/preview/development environment selection,
  • custom domains,
  • deployment protection/settings.

After changing Vercel environment variables, redeploy. Environment variable changes do not automatically affect old deployments.

Step 6: Smoke-test the restored app

Test at least:

  • home page loads,
  • login works,
  • catalogue pages load: categories, SubCat1, SubCat2, products, EANs,
  • EAN detail pages show data and images,
  • Ops EAN search works,
  • image thumbnails load from the restored Storage bucket,
  • price pages and graphs load,
  • TDB backup pages load,
  • one safe test insert/edit works in the restored/test project only.

Step 7: Production switch only after tests

Only after the restored/test app works should production traffic be moved. Possible production switch actions include:

  • updating Vercel production environment variables,
  • redeploying production,
  • changing the production domain assignment,
  • confirming the old production system is no longer being written to.

Do not do this

  • Do not test restore by overwriting the current working Supabase project.
  • Do not paste DB passwords or full connection URIs into ChatGPT.
  • Do not commit .env or secrets to Git.
  • Do not assume DB backup restores Storage images.
  • Do not assume Vercel config is restored just because the code is restored.

What this page does not do

  • This page does not run DB restore commands.
  • This page does not upload Storage files.
  • This page does not change Vercel settings.
  • This page does not change domains.
  • This page is only a restore/disaster-recovery runbook.