How to safely upgrade Bamboo and perform a rollback if needed?
0 reputation · 02 Nov 2023, 16:53 UTC
0 reputation · 02 Nov 2023, 16:53 UTC
Upgrading a Bamboo server safely depends on having a verified backup, applying the new binaries, and confirming that core functions such as plan execution, agent connectivity, and integrated tools operate as expected before declaring the upgrade successful. However, it is uncertain what specific verification criteria should trigger a rollback, how to ensure the backup itself is not corrupted or incomplete, and which early‑warning signals in startup logs or runtime metrics indicate a problematic upgrade.
What criteria should be used to decide that a rollback is necessary during the verification phase? How can backup integrity be validated prior to attempting a restore? Which logs, metrics, or health checks provide early detection of upgrade‑related failures that warrant a rollback?
35275 reputation · 02 Nov 2023, 23:23 UTC
Before touching a running Bamboo instance, make a full backup of the home directory and the database that backs it. The database snapshot must be taken while Bamboo is stopped to avoid partial writes.
sudo systemctl stop bamboo (or use the service script).tar czf /backups/bamboo-home-$(date +%F).tar.gz /opt/atlassian/bamboo/var
pg_dump -U bamboo_user -F c -b -v -f /backups/bamboo-db-$(date +%F).dump bamboo_db
/opt/atlassian/bamboo folder and unpack the new archive.sudo systemctl start bamboo. The first run triggers automatic schema migrations.atlassian-bamboo.log for a line “Database migration completed successfully”.http://server:8085/admin and confirm the displayed version matches the target.SEVERE or ERROR entries about database connectivity or migration failures in the log.pg_restore -U bamboo_user -d bamboo_db -v /backups/bamboo-db-$(date +%F).dump
tar xzf /backups/bamboo-home-$(date +%F).tar.gz -C /
Before using a backup for a real rollback, perform a dry‑run restore on a non‑production copy:
If the dry‑run succeeds, the backup can be trusted for an emergency rollback.
java.lang.OutOfMemoryError, high GC pause times, or repeated agent disconnects./status or /bamboo/api/health) returning non‑200 status.Do you use an external database (PostgreSQL/MySQL) or the embedded H2 database? This detail determines the snapshot commands shown above.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 03 Nov 2023, 04:51 UTC
Before trusting a backup for a rollback, verify that both the file‑system archive and the database dump are readable and complete. For the home directory, compute a SHA‑256 (or MD5) hash of the .tar.gz file and store it alongside the backup; after extracting the archive to a temporary location, recompute the hash and compare. For the PostgreSQL dump, run pg_restore -l /path/to/bamboo-db-*.dump to list the table of contents; if the command returns an error or an empty list, the dump is corrupted. Optionally, spin up a throw‑away Bamboo instance with a separate database, restore the dump there, and start Bamboo just long enough to confirm the version number appears in the administration console. Only after these checks succeed should you proceed with the actual rollback.