Skip to content

Migration Guide Generator Command

Create migration guides for updates

Instructions

Follow this systematic approach to create migration guides: $ARGUMENTS

  1. Migration Scope Analysis
  2. Identify what is being migrated (framework, library, architecture, etc.)
  3. Determine source and target versions or technologies
  4. Assess the scale and complexity of the migration
  5. Identify affected systems and components

  6. Impact Assessment

  7. Analyze breaking changes between versions
  8. Identify deprecated features and APIs
  9. Review new features and capabilities
  10. Assess compatibility requirements and constraints
  11. Evaluate performance and security implications

  12. Prerequisites and Requirements

  13. Document system requirements for the target version
  14. List required tools and dependencies
  15. Specify minimum versions and compatibility requirements
  16. Identify necessary skills and team preparation
  17. Outline infrastructure and environment needs

  18. Pre-Migration Preparation

  19. Create comprehensive backup strategies
  20. Set up development and testing environments
  21. Document current system state and configurations
  22. Establish rollback procedures and contingency plans
  23. Create migration timeline and milestones

  24. Step-by-Step Migration Process

Example for Framework Upgrade:

## Step 1: Environment Setup
1. Update development environment
2. Install new framework version
3. Update build tools and dependencies
4. Configure IDE and tooling

## Step 2: Dependencies Update
1. Update package.json/requirements.txt
2. Resolve dependency conflicts
3. Update related libraries
4. Test compatibility

## Step 3: Code Migration
1. Update import statements
2. Replace deprecated APIs
3. Update configuration files
4. Modify build scripts

  1. Breaking Changes Documentation
  2. List all breaking changes with examples
  3. Provide before/after code comparisons
  4. Explain the rationale behind changes
  5. Offer alternative approaches for removed features

Example Breaking Change:

### Removed: `oldMethod()`
**Before:**
```javascript
const result = library.oldMethod(param1, param2);

After:

const result = library.newMethod({ 
  param1: param1, 
  param2: param2 
});

Rationale: Improved type safety and extensibility ```

  1. Configuration Changes
  2. Document configuration file updates
  3. Explain new configuration options
  4. Provide configuration migration scripts
  5. Show environment-specific configurations

  6. Database Migration (if applicable)

  7. Create database schema migration scripts
  8. Document data transformation requirements
  9. Provide backup and restore procedures
  10. Test migration with sample data
  11. Plan for zero-downtime migrations

  12. Testing Strategy

  13. Update existing tests for new APIs
  14. Create migration-specific test cases
  15. Implement integration and E2E tests
  16. Set up performance and load testing
  17. Document test scenarios and expected outcomes

  18. Performance Considerations

    • Document performance changes and optimizations
    • Provide benchmarking guidelines
    • Identify potential performance regressions
    • Suggest monitoring and alerting updates
    • Include memory and resource usage changes
  19. Security Updates

    • Document security improvements and changes
    • Update authentication and authorization code
    • Review and update security configurations
    • Update dependency security scanning
    • Document new security best practices
  20. Deployment Strategy

    • Plan phased rollout approach
    • Create deployment scripts and automation
    • Set up monitoring and health checks
    • Plan for blue-green or canary deployments
    • Document rollback procedures
  21. Common Issues and Troubleshooting

    ## Common Migration Issues
    
    ### Issue: Import/Module Resolution Errors
    **Symptoms:** Cannot resolve module 'old-package'
    **Solution:** 
    1. Update import statements to new package names
    2. Check package.json for correct dependencies
    3. Clear node_modules and reinstall
    
    ### Issue: API Method Not Found
    **Symptoms:** TypeError: oldMethod is not a function
    **Solution:** Replace with new API as documented in step 3
    
  22. Team Communication and Training

    • Create team training materials
    • Schedule knowledge sharing sessions
    • Document new development workflows
    • Update coding standards and guidelines
    • Create quick reference guides
  23. Tools and Automation

    • Provide migration scripts and utilities
    • Create code transformation tools (codemods)
    • Set up automated compatibility checks
    • Implement CI/CD pipeline updates
    • Create validation and verification tools
  24. Timeline and Milestones

    ## Migration Timeline
    
    ### Phase 1: Preparation (Week 1-2)
    - [ ] Environment setup
    - [ ] Team training
    - [ ] Development environment migration
    
    ### Phase 2: Development (Week 3-6)
    - [ ] Core application migration
    - [ ] Testing and validation
    - [ ] Performance optimization
    
    ### Phase 3: Deployment (Week 7-8)
    - [ ] Staging deployment
    - [ ] Production deployment
    - [ ] Monitoring and support
    
  25. Risk Mitigation

    • Identify potential migration risks
    • Create contingency plans for each risk
    • Document escalation procedures
    • Plan for extended timeline scenarios
    • Prepare communication for stakeholders
  26. Post-Migration Tasks

    • Clean up deprecated code and configurations
    • Update documentation and README files
    • Review and optimize new implementation
    • Conduct post-migration retrospective
    • Plan for future maintenance and updates
  27. Validation and Testing

    • Create comprehensive test plans
    • Document acceptance criteria
    • Set up automated regression testing
    • Plan user acceptance testing
    • Implement monitoring and alerting
  28. Documentation Updates

    • Update API documentation
    • Revise development guides
    • Update deployment documentation
    • Create troubleshooting guides
    • Update team onboarding materials

Migration Types and Specific Considerations:

Framework Migration (React 17 → 18): - Update React and ReactDOM imports - Replace deprecated lifecycle methods - Update testing library methods - Handle concurrent features and Suspense

Database Migration (MySQL → PostgreSQL): - Convert SQL syntax differences - Update data types and constraints - Migrate stored procedures to functions - Update ORM configurations

Cloud Migration (On-premise → AWS): - Containerize applications - Update CI/CD pipelines - Configure cloud services - Implement infrastructure as code

Architecture Migration (Monolith → Microservices): - Identify service boundaries - Implement inter-service communication - Set up service discovery - Plan data consistency strategies

Remember to: - Test thoroughly in non-production environments first - Communicate progress and issues regularly - Document lessons learned for future migrations - Keep the migration guide updated based on real experiences