Upgrade OpenDataBio
3 minute read
Use this page for the common deployment sequence. Before upgrading, read
UPGRADES_NOTES.md
from the target version of OpenDataBio. It is the authoritative source for
version-specific prerequisites, storage permissions, migrations, backfills and
repair commands; those instructions are intentionally not duplicated here.
Before you start
- Read the target version’s
UPGRADES_NOTES.mdand release notes. Record every required preflight check and post-migration command before starting. - Back up at least:
- Database dump
.env- the complete
storage/apptree, including media, generated exports and persisted dataset-version archives
- Compare current config files against target-version templates/settings:
.envagainst.env.example(includingASSET_URL)- Supervisor worker config (
/etc/supervisor/conf.d/opendatabio-worker.confor container equivalent) - PHP config (
php.inifor CLI and FPM/Apache)
- Plan a maintenance window for production.
Upgrade (Apache or nginx installation)
- Put application in maintenance mode:
cd /home/odbserver/opendatabio
php artisan down
- Update source code:
git fetch --tags
git checkout <target-tag-or-branch>
- Install dependencies and run migrations:
composer install --no-dev --optimize-autoloader
php artisan migrate:status
php artisan migrate --force
- Run the post-migration commands listed in the target version’s
UPGRADES_NOTES.md, in the documented order. Some commands submit background UserJobs; keep the application in maintenance mode and monitor them until completion when the notes require it. - Rebuild frontend and Livewire assets after
.envchanges (required whenASSET_URLchanges):
sh scripts/build-assets.sh
- Refresh caches and restart workers:
php artisan optimize:clear
php artisan config:cache
php artisan queue:restart
systemctl restart supervisor.service
# Restart the web server and PHP-FPM as appropriate for your installation.
- Verify the application, queue workers, logs and the operations named in the upgrade notes, then bring the application back online:
php artisan up
Upgrade (Docker installation)
The commands below are for the production profile (docker-compose.prod.yml
and .env.production). For the bind-mounted development profile, rebuild with
make docker-init only when you intentionally want a development environment.
- Update source code and review configuration changes:
cd opendatabio
git fetch --tags
git checkout <target-tag-or-branch>
Compare .env.production with .env.production.example, without replacing the
existing application key or secrets.
- Put the current application in maintenance mode and build the new images:
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml exec -T -u www-data laravel php artisan down
make build-prod
- Start the new application container and run migrations:
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml up -d mysql redis laravel
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml exec -T -u www-data laravel php artisan migrate:status
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml exec -T -u www-data laravel php artisan migrate --force
- Run the target version’s
UPGRADES_NOTES.mdpost-migration commands inside the application container, in the documented order, and monitor any UserJobs they submit. - Refresh caches and recreate nginx and queue workers. Composer dependencies and frontend assets are already included in the production images:
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml exec -T -u www-data laravel php artisan optimize
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml up -d --force-recreate nginx supervisord
- Validate, then return the application to service:
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml exec -T -u www-data laravel php artisan locales:audit
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml exec -T -u www-data laravel php artisan up
docker compose --env-file .env.production -p odb-prod -f docker-compose.prod.yml ps
Environment variables
For Apache/nginx, compare .env with .env.example. For production Docker,
compare .env.production with .env.production.example. Follow
UPGRADES_NOTES.md for variables whose value or meaning changed; verify
APP_FORCE_HTTPS and ASSET_URL.
Rollback strategy
If something fails after migration:
- Keep maintenance mode on.
- Restore the database,
.env, and the matchingstorage/appbackup. Database rows and persisted dataset-version archives must be restored as one snapshot. - Checkout the previous known-good tag.
- Rebuild dependencies/containers and validate logs before
php artisan up.