Skip to content

Conversation

@matrixise
Copy link
Contributor

This PR adds an automated migration script to handle the Heroku-22 to Heroku-24 stack upgrade.

What's included

1. Migration Script (scripts/migrate-heroku-24.sh)

A comprehensive bash script that automates the entire migration process with built-in safety features:

Commands:

  • ./scripts/migrate-heroku-24.sh status - Check current stack status
  • ./scripts/migrate-heroku-24.sh migrate - Run migration to heroku-24
  • ./scripts/migrate-heroku-24.sh rollback - Rollback to heroku-22

Features:

  • βœ… Automatic database and config backups before migration
  • βœ… Maintenance mode handling (enables/disables automatically)
  • βœ… Automatic smoke tests after deployment (homepage, admin, logs)
  • βœ… Built-in rollback capability with one command
  • βœ… Confirmation prompts before critical actions
  • βœ… Detailed logging to timestamped files
  • βœ… Error handling with automatic rollback offer on failure

2. Complete Documentation (scripts/README-heroku-migration.md)

Full documentation including:

  • Prerequisites and setup
  • Usage examples
  • Features and safety mechanisms
  • Troubleshooting guide
  • Post-migration monitoring instructions
  • Environment variables
  • Exit codes reference

Testing

The script has been tested successfully:

  • βœ… status command works correctly
  • βœ… Shows current stack: heroku-22
  • βœ… PostgreSQL 17.6 info displayed
  • βœ… Identifies readiness for migration

Migration readiness

All 5 phases of migration testing have been completed successfully (see docs/heroku-24-migration-tests.md):

  • βœ… Phase 1-3: Verified production state, Python 3.13 compatibility, dependencies
  • βœ… Phase 4-5: Staging deployment successful with production data

The migration is ready for production.

Closes #180

Add automated migration script to handle Heroku-22 to Heroku-24 upgrade:

- Add scripts/migrate-heroku-24.sh: Automated migration script
  - Handles migration with safety checks and backups
  - Includes automatic rollback capability
  - Performs smoke tests after migration
  - Detailed logging and error handling

- Add scripts/README-heroku-migration.md: Complete documentation
  - Usage instructions and examples
  - Features and safety mechanisms
  - Troubleshooting guide
  - Post-migration monitoring instructions

Features:
βœ… Automatic database and config backups
βœ… Maintenance mode handling
βœ… Built-in smoke tests
βœ… One-command rollback
βœ… Confirmation prompts
βœ… Detailed logging

Related to #180
@matrixise matrixise closed this Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸš€ Migrate from Heroku-22 to Heroku-24 stack

2 participants