Back to changelog
New
2 minute read

Declarative Schema Backups

Atlas now replicates declarative schema state and pre-planned migrations to your own storage (S3, GCS, or Azure Blob Storage), with transparent fallback on read. Combined with the existing versioned-migration backups, every artifact in your Atlas Registry now has independent redundancy.

Atlas v1.2 introduced backup repositories for versioned migrations, replicating every atlas migrate push to your own object storage so the Atlas Registry is never a single point of failure. Atlas now extends the same model to declarative workflows: atlas schema push and atlas schema plan --push now replicate schema state and plan artifacts to the URLs configured under schema.repo.backup, and atlas:// reads transparently fall back to those backups on fallback-eligible errors.

Configure Backup URLs

Add a backup list to the schema.repo block. Atlas supports AWS S3, Google Cloud Storage, and Azure Blob Storage URLs. The same URLs should be kept on environments that read atlas://, so reads can fall back when Atlas Cloud is unavailable.

atlas.hcl
locals {
backup_urls = [
"s3://my-atlas-backups/example/schemas?region=us-east-1",
]
}
env "ci" {
dev = getenv("DEV_DATABASE_URL")
schema {
src = "file://schema.hcl"
repo {
name = "app"
backup = local.backup_urls
}
}
}
env "prod" {
url = getenv("DATABASE_URL")
dev = getenv("DEV_DATABASE_URL")
schema {
# Pull desired state from Atlas Registry.
src = "atlas://app"
# Keep backup URLs here as well, so atlas:// reads can fall back.
repo {
name = "app"
backup = local.backup_urls
}
}
}

Push Schema State

With backup URLs configured, atlas schema push writes the schema state to Atlas Cloud and to every backup URL in one call:

shell
atlas schema push \
--env ci \
--config file://atlas.hcl

If the Atlas Cloud push fails but at least one backup succeeds, Atlas reports a warning and the command still succeeds. Schema state remains accessible from at least one location.

Push Pre-Planned Migrations

atlas schema plan --push also replicates plan artifacts. The JSON output lists the backup URLs under Backups:

shell
atlas schema plan \
--env ci \
--config file://atlas.hcl \
--from file://schema_prev.hcl \
--to file://schema.hcl \
--repo atlas://app \
--push \
--auto-approve \
--format '{{ json . }}'
plan.json
{
"File": {
"URL": "atlas://app/plans/plan1",
"Status": "APPROVED"
},
"Backups": [
{
"URL": "s3://my-atlas-backups/example/schemas?region=us-east-1"
}
]
}

Business Continuity

Combined with versioned-migration backups and license grant caching, every artifact in the Atlas Registry, whether a migration directory, a schema state, or a pre-planned migration, now has independent redundancy. For end-to-end GitHub Actions + S3 setup, see the BCM/BCP for Declarative Schemas guide. For the broader context, see Service Availability.

featuredeclarative-schemabackupbusiness-continuityschema-push