โฌ๏ธ Upgrading
When a new version of Monitron SaaS is released, follow these steps to upgrade safely.
๐ Before You Upgradeโ
warning
Always back up before upgrading!
1. Back Up Your Databaseโ
# MySQL
mysqldump -u monitron_user -p monitron > backup_$(date +%Y%m%d).sql
# PostgreSQL
pg_dump -U monitron_user monitron > backup_$(date +%Y%m%d).sql
2. Back Up Your .env Fileโ
cp /var/www/monitron/.env /var/www/monitron/.env.backup
3. Back Up Uploaded Filesโ
cp -r /var/www/monitron/storage/app/public /tmp/monitron-uploads-backup
๐ Upgrade Stepsโ
Step 1: Enable Maintenance Modeโ
cd /var/www/monitron
php artisan down
This shows a "503 Service Unavailable" page to visitors and pauses all monitoring.
Step 2: Replace Application Filesโ
Upload or extract the new version files, but preserve these files/folders:
| Keep These | Why |
|---|---|
.env | Your configuration |
storage/ | Logs, cache, uploads |
storage/installed.lock | Prevents reinstall wizard |
# Example using rsync (preserves .env, storage, and vendor)
rsync -av --exclude='.env' --exclude='storage/' --exclude='vendor/' \
/path/to/new-version/ /var/www/monitron/
Step 3: Install Updated Dependenciesโ
composer install --no-dev --optimize-autoloader
Step 4: Run Database Migrationsโ
php artisan migrate --force
The --force flag is required in production.
Step 5: Clear All Cachesโ
php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan optimize
Step 6: Restart Queue Workersโ
php artisan queue:restart
# or
sudo supervisorctl restart monitron-worker:*
Step 7: Disable Maintenance Modeโ
php artisan up
โ Post-Upgrade Checklistโ
- Dashboard loads correctly
- Monitors are running (check
Last Checkcolumn) - Queue workers are processing (check
supervisorctl status) - Notifications are working (trigger a test)
- Status pages are accessible
- AI features work (if enabled)
- Check
storage/logs/laravel.logfor errors
๐ Rollbackโ
If something goes wrong:
# 1. Enable maintenance mode
php artisan down
# 2. Restore your database backup
mysql -u monitron_user -p monitron < backup_YYYYMMDD.sql
# 3. Restore the previous version files
# (replace with your backup method)
# 4. Restore .env if overwritten
cp .env.backup .env
# 5. Clear caches
php artisan config:clear
php artisan cache:clear
# 6. Disable maintenance mode
php artisan up