Skip to main content

Migration Overview

This guide walks you through migrating your BOOP integration from the development environment (dev.app.boop.it) to production (app.boop.it).
Production migration is irreversible. Ensure all testing is complete before proceeding.

πŸ“‹ Pre-Migration Requirements

Before starting migration, verify you have completed:
1

Complete Testing Checklist

βœ… Testing Checklist fully completed
2

Production Credentials

Obtain production credentials from BOOP team
3

Code Review

Security and code review approved by your team
4

Deployment Plan

Production deployment strategy finalized

πŸ” 1. Obtain Production Credentials

Request Process

Contact the BOOP team to request production access:
Email: [email protected] Subject: Production Access Request - [Your Company Name]Include:
  • Company information and use case
  • Development testing completion confirmation
  • Expected go-live date
  • Technical contact information

Credential Format

You’ll receive production credentials:
# Development (current)
BOOP_ENV=development
BOOP_VENDOR_ID=ven_dev_your_id
BOOP_API_KEY=sk_dev_your_secret_key
BOOP_BASE_URL=https://dev.app.boop.it

# Production (new)
BOOP_ENV=production
BOOP_VENDOR_ID=ven_live_your_id
BOOP_API_KEY=sk_live_your_secret_key
BOOP_BASE_URL=https://app.boop.it

πŸ”§ 2. Update Configuration

Environment Variables

Update your application configuration:
// config/boop.js
const config = {
  development: {
    baseUrl: 'https://dev.app.boop.it',
    vendorId: process.env.BOOP_DEV_VENDOR_ID,
    apiKey: process.env.BOOP_DEV_API_KEY,
    wsEndpoint: 'wss://dev.app.boop.it/ws/vendor'
  },
  production: {
    baseUrl: 'https://app.boop.it',
    vendorId: process.env.BOOP_PROD_VENDOR_ID,
    apiKey: process.env.BOOP_PROD_API_KEY,
    wsEndpoint: 'wss://app.boop.it/ws/vendor'
  }
};

export default config[process.env.NODE_ENV || 'development'];

Environment Detection

Implement environment detection to prevent accidental production calls:
class BoopClient {
  constructor(config) {
    this.config = config;

    // Safety check for production
    if (this.isProduction() && !process.env.CONFIRM_PRODUCTION) {
      throw new Error(
        'Production environment detected. Set CONFIRM_PRODUCTION=true to confirm.'
      );
    }
  }

  isProduction() {
    return this.config.baseUrl.includes('app.boop.it');
  }

  async authenticate(contextData) {
    if (this.isProduction()) {
      console.log('πŸš€ Using PRODUCTION BOOP environment');
    } else {
      console.log('πŸ§ͺ Using DEVELOPMENT BOOP environment');
    }

    // ... authentication logic
  }
}

πŸ”„ 3. Staged Deployment Strategy

1

Blue-Green Deployment

Deploy to production environment alongside existing system
2

Gradual Traffic Shift

Start with 5% traffic, then gradually increase
3

Monitoring Phase

Monitor for 24 hours at each traffic level
4

Full Deployment

Complete migration when stable

Traffic Routing Example

// Feature flag based routing
class PaymentRouter {
  constructor() {
    this.boopTrafficPercentage = parseInt(process.env.BOOP_TRAFFIC_PERCENT || '0');
  }

  shouldUseBoop(userId) {
    // Consistent user routing based on hash
    const userHash = this.hashUserId(userId);
    return userHash % 100 < this.boopTrafficPercentage;
  }

  async processPayment(userId, amount) {
    if (this.shouldUseBoop(userId)) {
      return await this.processBoopPayment(amount);
    } else {
      return await this.processLegacyPayment(amount);
    }
  }

  hashUserId(userId) {
    // Simple hash function for consistent routing
    return userId.split('').reduce((hash, char) => {
      return ((hash << 5) - hash + char.charCodeAt(0)) & 0xfffffff;
    }, 0);
  }
}

πŸ“Š 4. Production Verification

Health Check Verification

First, verify production connectivity:
# Test production health endpoint
curl https://app.boop.it/health

# Expected response
{
  "status": "ok",
  "version": "a1b2c3d"
}

Authentication Test

Perform a controlled production test:
// Production authentication test
const testProductionAuth = async () => {
  console.log('πŸ”¬ Testing production authentication...');

  const testConfig = {
    baseUrl: 'https://app.boop.it',
    vendorId: process.env.BOOP_PROD_VENDOR_ID,
    apiKey: process.env.BOOP_PROD_API_KEY,
    wsEndpoint: 'wss://app.boop.it/ws/vendor'
  };

  const client = new BoopClient(testConfig);

  try {
    // Test with minimal risk transaction
    const result = await client.authenticate({
      type: 'entrance',
      attributes: ['pseudonym']
    });

    if (result.success) {
      console.log('βœ… Production authentication successful');
      return true;
    } else {
      console.error('❌ Production authentication failed:', result.error);
      return false;
    }
  } catch (error) {
    console.error('πŸ’₯ Production test error:', error);
    return false;
  }
};

// Run verification
testProductionAuth()
  .then(success => {
    if (success) {
      console.log('πŸš€ Ready for production traffic');
    } else {
      console.log('πŸ›‘ Production issues detected - investigate before proceeding');
    }
  });

πŸ“ˆ 5. Monitoring & Observability

Essential Metrics

Monitor these key metrics during migration:
  • Success Rate: Target > 99.5%
  • Response Time: Target < 2 seconds
  • Error Rate: Target < 0.5%
  • Concurrent Users: Monitor capacity
  • Payment Success Rate: Target > 99.9%
  • Transaction Volume: Monitor processing capacity
  • Failed Payments: Should remain minimal
  • Revenue Impact: Track business metrics
  • WebSocket Connections: Monitor stability
  • API Response Times: Track latency
  • Error Rates by Endpoint: Identify issues
  • Uptime: Target 99.9% availability

Alerting Setup

Configure alerts for critical thresholds:
// Example monitoring configuration
const alertThresholds = {
  authentication: {
    errorRate: 1.0, // Alert if > 1% errors
    responseTime: 3000, // Alert if > 3 seconds
    successRate: 99.0 // Alert if < 99% success
  },
  payments: {
    errorRate: 0.1, // Alert if > 0.1% errors
    responseTime: 2000, // Alert if > 2 seconds
    successRate: 99.5 // Alert if < 99.5% success
  },
  infrastructure: {
    uptime: 99.0, // Alert if < 99% uptime
    connectionFailures: 5 // Alert if > 5 failures per minute
  }
};

// Implement monitoring logic based on your platform
// (DataDog, New Relic, CloudWatch, etc.)

🚨 6. Rollback Plan

Automatic Rollback Triggers

Configure automatic rollback for critical issues:
class AutoRollbackMonitor {
  constructor(thresholds) {
    this.thresholds = thresholds;
    this.consecutiveFailures = 0;
    this.maxFailures = 5;
  }

  checkMetrics(metrics) {
    const issues = [];

    if (metrics.errorRate > this.thresholds.errorRate) {
      issues.push(`Error rate ${metrics.errorRate}% exceeds threshold ${this.thresholds.errorRate}%`);
    }

    if (metrics.responseTime > this.thresholds.responseTime) {
      issues.push(`Response time ${metrics.responseTime}ms exceeds threshold ${this.thresholds.responseTime}ms`);
    }

    if (issues.length > 0) {
      this.consecutiveFailures++;

      if (this.consecutiveFailures >= this.maxFailures) {
        this.triggerRollback(issues);
      }
    } else {
      this.consecutiveFailures = 0;
    }
  }

  triggerRollback(issues) {
    console.error('🚨 AUTOMATIC ROLLBACK TRIGGERED');
    console.error('Issues detected:', issues);

    // Implement rollback logic:
    // 1. Switch traffic back to previous system
    // 2. Alert engineering team
    // 3. Preserve logs for analysis

    this.executeRollback();
  }

  executeRollback() {
    // Implementation depends on your deployment strategy
    // Examples:
    // - Feature flag toggle
    // - Traffic routing change
    // - Container rollback
    // - DNS switch
  }
}

Manual Rollback Process

In case manual intervention is needed:
1

Stop New Traffic

Immediately stop routing new transactions to BOOP
2

Complete In-Flight

Allow existing transactions to complete
3

Switch Back

Route all traffic to previous payment system
4

Preserve Data

Save all logs and metrics for analysis
5

Notify Team

Alert engineering and business teams

βœ… 7. Post-Migration Checklist

After successful migration, complete these tasks:

Immediate (First 24 Hours)

  • Monitor all metrics closely
  • Verify customer experience is smooth
  • Check error logs for any issues
  • Validate payment processing accuracy
  • Confirm all features working as expected

Short Term (First Week)

  • Analyze performance compared to dev environment
  • Gather user feedback
  • Document any issues and resolutions
  • Update team training materials
  • Review and optimize monitoring

Ongoing

  • Weekly performance reviews
  • Monthly security audits
  • Quarterly disaster recovery testing
  • Annual credential rotation
  • Continuous feature testing

πŸŽ‰ Migration Success!

Congratulations! You’ve successfully migrated to production.

Next Steps

Support & Resources

Remember: The BOOP team is here to support your production journey. Don’t hesitate to reach out if you encounter any issues or need assistance.