upskill-event-manager/wordpress-dev/MIGRATION_GUIDE.md
bengizmo d1509b3d60 feat(dev-env): implement backup-based development workflow
This commit introduces a more reliable and consistent approach to setting up
the development environment using backups:

- Add setup-from-backup.sh script for environment setup from existing backups
- Standardize script naming and organization
- Move obsolete scripts to bin/obsolete directory
- Update documentation with new workflow instructions
- Create migration guide for transitioning to new workflow
- Update Memory Bank with workflow improvements

The new workflow provides:
- More reliable environment setup
- Faster setup process
- Offline development capability
- Consistent development environments across team members

Breaking changes:
- setup-dev.sh is replaced by setup-from-backup.sh
- sync-and-setup.sh is replaced by separate scripts
- verify-with-wpcli.sh is no longer used

Migration path is documented in MIGRATION_GUIDE.md
2025-03-26 11:26:18 -03:00

3.3 KiB

Migration Guide: Development Environment Workflow

Status: Active/Authoritative Last Updated: March 26, 2025 Scope: Transition from old to new development environment workflow

This guide helps you transition from the old development environment workflow to the new backup-based workflow.

Overview of Changes

The development environment workflow has been updated to use a backup-based approach:

Old Workflow

setup-dev.sh → sync-production.sh → verify-dev.sh

New Workflow

sync-production.sh → setup-from-backup.sh → verify-dev.sh

Why the Change?

  1. More Reliable: The new workflow uses existing backups, reducing the chance of errors during setup
  2. Faster Setup: Setting up from a backup is faster than syncing directly from production
  3. Offline Support: You can set up the environment without needing access to the production server
  4. Consistent Environment: Everyone uses the same backup, ensuring consistent development environments

Migration Steps

Step 1: Update Your Repository

# Pull the latest changes
git pull

# Make sure you have the new scripts
ls -la bin/setup-from-backup.sh

Step 2: Clean Up Your Current Environment (Optional)

If you want to start fresh:

# Stop and remove containers
docker-compose down

# Remove volumes (optional, will delete all data)
docker volume prune -f

Step 3: Check for Existing Backups

# List available backups
ls -la backups/

If no backups are available, create one:

# Create a new backup from production
./bin/sync-production.sh

Step 4: Set Up Using the New Workflow

# Set up from the latest backup
./bin/setup-from-backup.sh

# Verify the environment
./bin/verify-dev.sh

Script Mapping

Old Script New Script Notes
setup-dev.sh setup-from-backup.sh New script uses existing backups
sync-production.sh sync-production.sh Same name, updated implementation
verify-dev.sh verify-dev.sh Same name, updated implementation
sync-and-setup.sh Use both scripts separately Split into two separate steps

Common Issues and Solutions

"No backup found in backups/ directory!"

# Create a new backup from production
./bin/sync-production.sh

"Cannot connect to production server"

You can still set up the environment if someone else has created a backup:

  1. Get a backup from another developer
  2. Place it in the backups/ directory
  3. Run ./bin/setup-from-backup.sh

"Database connection issues"

# Check database container
docker-compose ps | grep db

# Restart containers
docker-compose down && docker-compose up -d

# Verify database connection
./bin/verify-simple.sh

"WordPress is not accessible"

# Check if WordPress container is running
docker-compose ps | grep wordpress

# Check WordPress logs
docker-compose logs wordpress

# Restart containers
docker-compose down && docker-compose up -d

Additional Resources

Support

If you encounter any issues with the new workflow, please contact:

Last Updated: March 26, 2025