Skip to content

Emergency Rollback Procedures

If an upgrade fails or the system becomes unstable, use this guide to revert to your previous stable state.

IMPORTANT

A successful rollback requires the Database and File backups created during the Prerequisites phase.

1. Stop the Failed Instance

Immediately stop the current containers to prevent data corruption.

bash
# For Docker Compose
docker-compose down

# For Docker Run
docker stop BrowserStackCodeQuality && docker rm BrowserStackCodeQuality

2. Restore the Database

You must restore your database backup. Newer application versions often modify the database schema, making them incompatible with older versions.

bash
# 1. Drop the current (failed) databases
docker exec -it embold_db_1 psql -U postgres -c "DROP DATABASE corona; DROP DATABASE gamma;"

# 2. Re-create empty databases
docker exec -it embold_db_1 psql -U postgres -c "CREATE DATABASE corona; CREATE DATABASE gamma;"

# 3. Restore from your pre-upgrade .sql file
docker exec -i embold_db_1 psql -U postgres -d corona < embold_db_backup_DATE.sql

3. Revert Image Version

Change the version tag back to your previous stable version in your docker-compose.yml or docker run command.

Example (Docker Compose):

yaml
services:
  app:
    image: "browserstack/code-quality:PREVIOUS_STABLE_VERSION"

4. Verification Checklist

  • [ ] Container Status: docker ps shows all containers as Up.
  • [ ] UI Access: Login and verify the version in Admin > System Info.
  • [ ] Data Integrity: Check if previous projects and scan history are visible.