LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • wheels generate app
        • wheels generate app-wizard
        • wheels generate controller
        • wheels generate model
        • wheels generate view
        • wheels generate property
        • wheels generate route
        • wheels generate resource
        • wheels generate api-resource
        • wheels generate frontend
        • wheels generate test
        • wheels generate snippets
        • wheels scaffold
      • Database Commands
        • wheels dbmigrate info
        • wheels dbmigrate latest
        • wheels dbmigrate up
        • wheels dbmigrate down
        • wheels dbmigrate reset
        • wheels dbmigrate exec
        • wheels dbmigrate create blank
        • wheels dbmigrate create table
        • wheels dbmigrate create column
        • wheels dbmigrate remove table
        • wheels db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • wheels deploy
        • wheels deploy audit
        • wheels deploy exec
        • wheels deploy hooks
        • wheels deploy init
        • wheels deploy lock
        • wheels deploy logs
        • wheels deploy proxy
        • wheels deploy push
        • wheels deploy rollback
        • wheels deploy secrets
        • wheels deploy setup
        • wheels deploy status
        • wheels deploy stop
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Synopsis
  • Description
  • Arguments
  • Options
  • Examples
  • Rollback to previous release
  • Rollback multiple releases
  • Rollback to specific release
  • Preview rollback
  • Force rollback without confirmation
  • Rollback Process
  • Output Example
  • Available Releases
  • Rollback Hooks
  • Database Rollback
  • Rollback Strategies
  • Immediate Rollback
  • Staged Rollback
  • Blue-Green Rollback
  • Emergency Rollback
  • Rollback Validation
  • Preventing Rollback Issues
  • Rollback Limitations
  • Use Cases
  • Monitoring After Rollback
  • Notes
  • See Also

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Deployment Commands

wheels deploy rollback

Rollback a deployment to a previous release.

Synopsis

wheels deploy rollback [target] [options]

Description

The wheels deploy rollback command reverts your application to a previous deployment release. It provides quick recovery from failed deployments or problematic releases by switching back to a known-good state.

Arguments

Argument
Description
Default

target

Deployment target to rollback

Required

Options

Option
Description
Default

--release

Specific release to rollback to

Previous release

--steps

Number of releases to rollback

1

--skip-hooks

Skip rollback hooks

false

--force

Force rollback without confirmation

false

--dry-run

Preview rollback without executing

false

--verbose

Show detailed output

false

--help

Show help information

Examples

Rollback to previous release

wheels deploy rollback production

Rollback multiple releases

wheels deploy rollback production --steps=2

Rollback to specific release

wheels deploy rollback production --release=20240114093045

Preview rollback

wheels deploy rollback production --dry-run

Force rollback without confirmation

wheels deploy rollback production --force

Rollback Process

  1. Validation:

    • Verify target configuration

    • Check available releases

    • Validate rollback target

  2. Confirmation:

    • Display current release

    • Show target release

    • Request confirmation (unless --force)

  3. Execution:

    • Switch symbolic links

    • Run rollback hooks

    • Restore shared resources

    • Clear caches

  4. Verification:

    • Test application health

    • Verify services running

    • Check error logs

Output Example

Rolling back production deployment...

Current Release: 20240115120000
Target Release:  20240114093045

Changes to be reverted:
- 45 files modified
- 3 database migrations
- 2 configuration changes

? Proceed with rollback? (y/N) y

✓ Switching to release 20240114093045
✓ Running rollback hooks
  → Reverting database migrations
  → Clearing application cache
  → Restarting services
✓ Verifying application health
✓ Rollback completed successfully!

Rollback Summary:
- From: 20240115120000
- To:   20240114093045
- Duration: 45s
- Status: SUCCESS

Available Releases

List available releases:

wheels deploy status production --releases

Output:

Available releases for production:
1. 20240115120000 (current)
2. 20240114093045
3. 20240113154522
4. 20240112101133
5. 20240111163421

Rollback Hooks

Configure rollback-specific hooks:

{
  "hooks": {
    "rollback": [
      "wheels dbmigrate down --steps=1",
      "wheels reload production",
      "npm run cache:clear",
      "curl -X POST https://api.example.com/rollback-notification"
    ]
  }
}

Database Rollback

Handling database changes during rollback:

  1. Automatic Migration Rollback:

    wheels dbmigrate down --to=20240114093045
  2. Manual Intervention:

    • Some changes may require manual rollback

    • Data migrations might not be reversible

    • Always backup before deployment

Rollback Strategies

Immediate Rollback

Quick switch to previous release:

wheels deploy rollback production

Staged Rollback

Gradual rollback with canary:

wheels deploy rollback production --strategy=canary --percentage=10

Blue-Green Rollback

Instant switch between environments:

wheels deploy rollback production --strategy=blue-green

Emergency Rollback

For critical situations:

# Skip all checks and hooks
wheels deploy rollback production --force --skip-hooks

# Direct symbolic link switch (last resort)
ssh deploy@prod.example.com "cd /var/www/app && ln -sfn releases/20240114093045 current"

Rollback Validation

After rollback, verify:

  1. Application Health:

    wheels deploy status production --health
  2. Service Status:

    ssh deploy@prod.example.com "systemctl status cfml-app"
  3. Error Logs:

    wheels deploy logs production --tail=100 --filter=error

Preventing Rollback Issues

  1. Keep Sufficient Releases:

    • Configure keepReleases appropriately

    • Don't set too low (minimum 3-5)

  2. Test Rollback Procedures:

    • Practice in staging environment

    • Document manual procedures

    • Automate where possible

  3. Database Considerations:

    • Design reversible migrations

    • Backup before deployment

    • Test rollback scenarios

Rollback Limitations

  • Shared files/directories not rolled back

  • User-uploaded content preserved

  • External service changes not reverted

  • Some database changes irreversible

Use Cases

  1. Failed Deployment: Immediate recovery from deployment failure

  2. Performance Issues: Revert problematic release

  3. Critical Bugs: Quick fix by reverting

  4. Testing Rollback: Verify rollback procedures work

  5. Compliance: Revert unauthorized changes

Monitoring After Rollback

  • Check application performance

  • Monitor error rates

  • Verify user functionality

  • Review system resources

  • Analyze root cause

Notes

  • Always investigate why rollback was needed

  • Document rollback incidents

  • Update deployment procedures based on learnings

  • Consider implementing better pre-deployment testing

  • Communicate rollback to stakeholders

See Also

Previouswheels deploy pushNextwheels deploy secrets

Last updated 2 days ago

Was this helpful?

- Execute deployment

- Check deployment status

- View deployment logs

- Rollback migrations

wheels deploy exec
wheels deploy status
wheels deploy logs
wheels dbmigrate down