Zero Downtime Migration
Section titled “Zero Downtime Migration”This guide provides step-by-step instructions for migrating your applications from Vercel, Netlify, AWS, or another provider to Sherpa.sh with zero downtime.
Prerequisites
Section titled “Prerequisites”- An active Sherpa.sh account
- Access to your current hosting platform (Vercel, Netlify, AWS, etc)
- Access to your DNS provider
- Your application’s source code repository
Zero-Downtime Migration Strategy
Section titled “Zero-Downtime Migration Strategy”The key to a zero-downtime migration is to set up and verify your application on Sherpa.sh before changing your DNS settings. This is accomplished through a parallel deployment strategy:
The Parallel Deployment Method
Section titled “The Parallel Deployment Method”- Deploy to Sherpa.sh while keeping your existing deployment active
- Verify functionality using Sherpa.sh temporary URLs
- Implement DNS changes using a phased approach
- Monitor and finalize the migration
DNS Migration best practices
Section titled “DNS Migration best practices”To avoid downtime during DNS propagation:
- Lower TTL values in advance:
- At least 24-48 hours before migration, reduce the TTL (Time To Live) values for your DNS records to the minimum allowed value (often 300 seconds/5 minutes)
- This ensures faster propagation when you make the actual switch
- Use Sherpa.sh’s preview environment:
- Before changing production DNS, fully test your application on Sherpa.sh’s preview domain. Follow the getting started guide to deploy your application on a preview domain
- Implement CNAME flattening (if supported by your DNS provider):
- Set up CNAME records pointing to the records displayed when you setup your custom domain in the Sherpa.sh panel
- This provides more flexibility during the transition
- Use parallel DNS configuration:
- Configure your application on Sherpa.sh to respond to your domain. For example, set allowed hosts to include your domain.
- Verify your application is working on the preview domain
Migration Process
Section titled “Migration Process”1. Connect and deploy your app on a preview domain
Section titled “1. Connect and deploy your app on a preview domain”Follow the getting started guide to deploy your application on a preview domain
2. DNS Migration
Section titled “2. DNS Migration”- In your DNS provider:
- Use a temporary subdomain and point it with CNAMEs to the records displayed when you setup your custom domain in the Sherpa.sh panel
- Keep your existing DNS records active
- Test the Sherpa.sh deployment using the temporary subdomain. Don’t forget to add the domain to your allowed hosts or similiar setting in your application.
3. Migrate Traffic
Section titled “3. Migrate Traffic ”For mission-critical applications, use this blue-green deployment approach:
- Set up complete infrastructure on Sherpa.sh (the “green” environment, like you did in step 1)
- Keep your current platform running (the “blue” environment)
- Use a load balancer or traffic manager to control traffic distribution. Some DNS providers will allow you to do this from DNS itself. This is the recomend way.
- Gradually shift traffic percentages from blue to green
- Monitor for any issues and be prepared to shift back if necessary
4. Testing
Section titled “4. Testing”- Once you’ve traffic shifted fully to sherpa.sh, test your application.
- Keep the original deployment on your old provider active for 24-48 hours as fallback while you test the new production environment
- You can remove the old DNS records once you are confident the migration was successful.
Troubleshooting
Section titled “Troubleshooting”Common Issues and Solutions
Section titled “Common Issues and Solutions”DNS Propagation Problems
- Issue: Some users see the new site while others see the old one
- Solution: This is normal during DNS propagation. Wait 24-48 hours for full propagation, and keep both deployments active during this period.
Missing Environment Variables
- Issue: Application errors related to configuration
- Solution: Verify all environment variables are correctly set in Sherpa.sh dashboard
Build Failures
- Issue: Deployment fails on Sherpa.sh
- Solution: Check build logs and adjust configuration based on differences between platforms
Database Connection Problems
- Issue: Application cannot connect to database
- Solution: Verify connection strings and network access settings. You may need to allow all IPs to access your database if you are not using a sherpa.sh managed database.
Getting Help
Section titled “Getting Help”If you encounter issues during migration, contact Sherpa.sh support in discord: