Cloud App Backup and Rollback Runbook: What to Save Before Every Deployment
deploymentsbackupsrollbackDevOpscloud applications

Cloud App Backup and Rollback Runbook: What to Save Before Every Deployment

wwhata.cloud Editorial Team
2026-11-30
7 min read

A practical cloud deployment rollback runbook covering application files, databases, secrets, DNS, storage, backup tests, and review cadence.

A failed deployment is easier to recover from when rollback is planned before release day. This runbook gives you a repeatable application backup checklist, a practical backup matrix, rollback decision points, and a review cadence for files, databases, environment variables, DNS, and persistent storage on cloud hosting or a VPS.

Overview

Rolling back application code is usually the simple part. The difficult part is restoring the rest of the system to a compatible state without overwriting newer customer data or losing configuration. A previous application version may expect an older database schema, a particular environment variable, a specific container image, or a persistent volume with a known structure.

Before every deployment, identify what will change, what must be preserved, and what can be reversed. Your rollback plan should answer five questions:

  • Which application version was running successfully before the release?
  • Where are the deployable files, container images, and infrastructure definitions stored?
  • When was the last verified database and persistent-storage backup created?
  • Which environment variables, secrets, DNS records, and scheduled jobs does the release depend on?
  • Who has authority to pause traffic, restore data, or declare the rollback complete?

A rollback is not the same as a restore. A rollback changes the application to an earlier release. A restore replaces data or infrastructure with an earlier copy. Use the least destructive action that resolves the incident. If the new code is faulty but has not changed the data model, an application rollback may be enough. If a migration damaged or transformed data, you may need a carefully planned database recovery instead.

For broader disaster-recovery planning, compare this runbook with the cloud server backup and restore plan, which covers snapshots, offsite copies, and recovery testing.

What to track

Keep a release record for every deployment. It can live in version control, an issue tracker, or a simple operations log, provided the record is accessible during an incident. Record the commit or image digest, deployment time, operator, migration status, backup identifiers, and the result of post-deployment checks.

Application and infrastructure assets

  • Source and build output: preserve the exact commit, build artifact, dependency lockfile, and container image tag or immutable digest. Avoid relying only on a moving tag such as latest.
  • Deployment configuration: save the relevant compose file, manifest, service definition, reverse-proxy configuration, infrastructure code, and startup commands. Note the operating-system or server-image version when it affects the application.
  • Environment variables and secrets: maintain a secure, versioned inventory of variable names, not plaintext secret values in a public repository. Confirm that the previous release can access the credentials it needs.
  • Persistent storage: list attached volumes, upload directories, object-storage buckets, queues, and generated files. A virtual-machine snapshot may not cover external services or independently managed storage.

Data and control-plane changes

  • Database: capture the database engine, schema version, backup timestamp, retention period, and restore procedure. For a relational database, a logical export such as pg_dump or mysqldump can complement provider snapshots; adapt the command to your engine and access controls.
  • Migrations: label each migration as backward-compatible, reversible, or requiring a data recovery plan. Test whether the old application can read the post-migration schema before deploying code that depends on it.
  • DNS and certificates: record the current DNS records, nameservers, proxy settings, certificate source, and renewal method. Do not change DNS as a first response when an application-only rollback will restore service.
  • External integrations: note webhook endpoints, payment or email settings, API versions, queues, cron jobs, and callback URLs. These dependencies can remain pointed at a new release even after the web application has been reverted.

Backup matrix

AssetBefore deploymentRecovery checkRollback caution
Application artifactRecord immutable commit, image digest, or archiveStart it in a staging or isolated environmentKeep dependencies compatible with the runtime
DatabaseCreate or verify a recent backup and record its IDRestore a copy and run a smoke testDo not overwrite newer valid data without an explicit decision
Environment configurationSnapshot variable names and encrypted secret referencesCheck required values and permissionsNever place secret values in deployment logs
Persistent filesCopy or snapshot uploads and application dataOpen representative files from the copyCheck consistency when writes continue during backup
DNS and certificatesExport records and document current providersConfirm the expected endpoint and certificate chainDNS changes may be cached and are not instant rollback controls

Cadence and checkpoints

Use the following checkpoints as a minimum operating rhythm. High-risk releases, such as database migrations or changes to storage, need additional review.

Before each deployment

  1. Confirm the release identifier and save the last known-good identifier.
  2. Review migrations for compatibility, reversibility, and expected runtime.
  3. Verify the database backup completed successfully and is available from the recovery environment.
  4. Confirm that persistent-storage copies are current enough for the release risk.
  5. Record environment, DNS, certificate, queue, and scheduled-job dependencies.
  6. Write the rollback command sequence before starting the deployment.

Immediately after deployment

Run a short smoke-test set: load the public site, authenticate a test account, exercise the most important read and write path, inspect logs, check background workers, and verify error rates or application health checks. Keep the release record open until these checks pass.

Monthly or quarterly

Perform a restore drill in an isolated environment. Measure how long it takes to obtain the backup, restore the database, attach persistent storage, configure the application, and validate the result. Review backup retention, offsite access, encryption, permissions, and available disk space. Update commands and screenshots when your cloud provider, server image, deployment platform, or database version changes.

If your cloud server is regularly approaching resource limits, review the VPS capacity and right-sizing guide. A rollback can fail simply because the recovery target lacks storage, memory, or CPU capacity.

How to interpret changes

Use symptoms and change scope to choose the least destructive response. This decision table is a starting point, not a substitute for examining logs and data integrity.

Observed problemLikely first actionEscalate when
New code returns errors but data is intactPause the release and restore the last known-good application artifactThe old artifact cannot start with the current configuration or schema
Migration fails before completionFollow the migration tool's documented recovery path and preserve logsSchema state is uncertain or writes continued during the failure
Records or files are missing or corruptedStop destructive jobs and identify the latest trustworthy data pointA database or storage restore is required
Only one hostname or endpoint failsCheck application routing, certificate coverage, and DNS recordsNameservers or DNS records were changed and propagation is involved
Workers repeatedly process old or duplicate jobsPause workers and inspect queue visibility, idempotency, and release compatibilityExternal side effects cannot be safely repeated or reversed

Be especially cautious with irreversible migrations, destructive scripts, and changes that write to an external service. A code rollback cannot undo an email sent, a payment initiated, or a record deleted in another system. For DNS symptoms, use a measured review of nameservers, TTLs, caches, and authoritative answers rather than repeatedly changing records; the DNS propagation troubleshooting guide provides a useful companion workflow.

Define recovery objectives in practical terms: the maximum acceptable amount of lost data and the target time to restore service. These limits determine whether a daily backup, frequent logical export, replica, snapshot, or another design is appropriate. Do not promise a recovery time your team has not tested.

When to revisit

Revisit this runbook before every deployment and after any infrastructure change. Schedule a formal review at least monthly or quarterly, depending on release frequency and business risk. Trigger an immediate update when you change cloud hosting providers, VPS images, databases, container runtimes, deployment tools, DNS providers, certificate automation, storage locations, or secret-management systems.

Use a simple review checklist:

  • Can a new operator find the last known-good release and the required backup?
  • Do the rollback commands still match the current deployment architecture?
  • Has a restore been completed recently, rather than merely marked successful by a backup job?
  • Are database and storage backups protected from the same failure that affects production?
  • Do retention periods match the data's operational and legal requirements?
  • Are DNS, email, certificates, queues, and external integrations included in the recovery test?

Before your next release, create one release folder or ticket containing the artifact identifier, backup IDs, migration notes, configuration references, smoke-test results, and rollback owner. Then run a small restore test before you need a full one. A rollback plan is useful only when its files are accessible, its commands are current, and its recovery steps have been proven against the stack you operate today.

Related Topics

#deployments#backups#rollback#DevOps#cloud applications
w

whata.cloud Editorial Team

Developer Hosting Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.