Test in staging first
Every upgrade should run through staging with a copy of live data. Staging is an isolated Docker Compose project with its own.env and .data/ directory, so a failed upgrade there cannot harm production.
For environment setup, see Environments.
Upgrade flow
1
Take a fresh backup
Before changing anything, back up the environment you are upgrading:
2
Pull the new release
Update your checkout to the latest release:
3
Install dependencies
Pick up any new or updated packages:
4
Rebuild images if needed
If bake-time environment variables changed (for example,
REQUIRE_LOGIN_FOR_PRICES), rebuild the images so the new values are baked in. For a full list of bake-time variables, see Environment variables.5
Restart the environment
Bring the environment down and back up:
6
Run migrations
Medusa migrations run automatically on container start. Payload migrations also run on start. Confirm both complete without errors in the logs.
7
Verify
Run health checks to confirm the upgrade succeeded:
Rollback
If verification fails, restore from the backup you took before starting:Upgrade Fox
Fox upgrades are separate from environment upgrades:Never upgrade live without first upgrading staging with the same data. Restore a live backup into staging if you need identical conditions.
Backup and restore
Create and restore backups before and after every upgrade.
Logs and health
Tail logs and run health checks to spot upgrade issues early.