.env.backup.production !new! Jun 2026
of these backups using a specific tool like GitHub Actions or a shell script?
You don't want to manually create this file every time you change a variable. Instead, integrate it into your deployment workflow. Here is a simple example using a Bash script that could run at the end of a successful deployment: .env.backup.production
One backup is never enough. You should maintain a rotation: of these backups using a specific tool like
DB_HOST=prod-db-cluster.internal DB_PORT=5432 DB_NAME=app_production DB_USER=app_user DB_PASSWORD=actual_password_here DATABASE_URL=postgresql://app_user:actual_password_here@prod-db-cluster.internal:5432/app_production .env.backup.production
age -d .env.backup.production.age > .env.backup.production