Docs Getting started
Upgrading
Update a Snapsbrew instance to a new version, with Docker or without Docker.
An upgrade gets the new code, rebuilds the assets and runs the new migrations.
CAUTION: Make a backup of the database and the storage before you upgrade. A migration can change data. Read Backups.
Upgrade with Docker
-
Make a backup of the
mysqlandstoragevolumes. -
Get the new code:
git pull -
Rebuild the image and restart the stack:
docker compose up -d --build -
Wait until the
webcontainer is healthy:docker compose ps
The web container runs the new migrations when it starts. Horizon and the scheduler start again after web is healthy.
If docker-compose.yml changes the Browserless image tag, Compose pulls the new image. The renderer code and the Browserless tag change together, because a new Browserless major version can change the /screenshot payload.
Upgrade without Docker
-
Make a backup of the database and the
storagefolder. -
Put the app in maintenance mode:
php artisan down -
Get the new code:
git pull -
Install the PHP packages and the Node packages:
composer install --no-dev --optimize-autoloader npm ci -
Build the assets:
npm run build -
Run the migrations:
php artisan migrate --force -
Cache the configuration, the routes and the views again:
php artisan config:cache php artisan route:cache php artisan view:cache -
Stop Horizon so that it starts again with the new code:
php artisan horizon:terminate -
Make the app available again:
php artisan up
Step 8 stops the Horizon process after the current jobs. Your process manager must start it again. Read Queues and Horizon.
After the upgrade
- Open
/up. It must return 200. - Open
/horizonas the owner. Make sure that the workers run. - Render a test snap.
If a render fails after the upgrade, read Troubleshooting.
Commands for old data
Some commands repair or copy data that older versions stored. Run them only when a release note tells you to:
| Command | What it does |
|---|---|
php artisan editor:backfill-template-documents |
Copies old layer data into the v2 editor document columns. Options: --table=templates or --table=template_versions, --after-id, --limit (1 to 5000, default 500). |
php artisan sb:remove-template-layers-title |
Removes the title field from the stored layers of each template. |