AWS is the dominant cloud platform globally — but for many Asia-Pacific businesses, it is also significantly overpriced for their actual workload. A comparable compute and storage configuration on a Hong Kong VPS with CN2 GIA routing typically costs 60–80% less than equivalent AWS ap-east-1 (Hong Kong) resources, without sacrificing the performance characteristics that matter most for China connectivity.
This guide walks through migrating a typical web application stack from AWS to a Hong Kong VPS, covering compute, database, storage, and DNS cutover with minimal downtime.
Why Businesses Migrate from AWS to Hong Kong VPS
Cost Reduction
| Resource | AWS ap-east-1 (HK) | Server.HK VPS | Savings |
|---|---|---|---|
| 2 vCPU / 4 GB RAM | ~$70/month (t3.medium) | ~$15–25/month | ~65–80% |
| 4 vCPU / 16 GB RAM | ~$150/month (t3.xlarge) | ~$40–60/month | ~60–75% |
| 100 GB SSD storage | ~$10/month (gp3 EBS) | Included in VPS | 100% |
| Data transfer (100 GB/month) | ~$9/month | Typically included | 100% |
| CN2 GIA routing | Not available | Included | Better performance |
China Connectivity
AWS ap-east-1 uses standard internet routing to mainland China — the same 163 backbone congestion that standard hosting providers use. Server.HK’s CN2 GIA routing provides significantly lower latency and packet loss for China-facing applications, which AWS cannot match in its Hong Kong region.
Operational Simplicity
For applications that don’t use AWS-specific managed services (Lambda, SQS, DynamoDB, EKS), a VPS is operationally simpler — one server, predictable pricing, no surprise bills from data transfer or API call overages.
Before You Start: Audit Your AWS Stack
Before migrating, catalogue every AWS service your application uses:
# Export your AWS resource inventory
aws resourcegroupstaggingapi get-resources \
--region ap-east-1 \
--output tableCommon services and their VPS equivalents:
| AWS Service | VPS Equivalent | Notes |
|---|---|---|
| EC2 (compute) | VPS instance | Direct replacement |
| RDS MySQL/PostgreSQL | Self-managed MySQL/PostgreSQL on VPS | Requires backup setup |
| S3 (object storage) | MinIO on VPS or Cloudflare R2 | S3-compatible APIs |
| CloudFront (CDN) | Cloudflare (free tier) or Bunny CDN | Often better China coverage |
| ALB (load balancer) | Nginx or HAProxy on VPS | Self-managed |
| Route 53 (DNS) | Cloudflare DNS (free) or AWS Route 53 | Can keep Route 53 separately |
| SES (email) | Postfix on VPS or external SaaS (Resend, Postmark) | SaaS is easier |
| ElastiCache (Redis) | Self-managed Redis on VPS | Direct replacement |
| Lambda (serverless functions) | No direct equivalent — refactor to long-running process | Requires code changes |
| SQS (message queue) | RabbitMQ or Redis Pub/Sub on VPS | More operational overhead |
Note: If your application heavily uses Lambda, SQS, or other AWS-native managed services, migration complexity increases significantly. This guide focuses on EC2 + RDS + S3 stacks — the most common configuration.
Step 1: Provision and Configure Your Hong Kong VPS
# Update and install base packages
apt update && apt upgrade -y
apt install -y nginx mysql-server redis-server certbot python3-certbot-nginx \
ufw fail2ban curl wget git
# Configure firewall
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw enableInstall your application runtime (PHP, Node.js, Python) to match your EC2 environment.
Step 2: Migrate Your Database (RDS → Self-Managed MySQL)
Export from AWS RDS
# Export from RDS (run from your EC2 or local machine)
mysqldump \
-h your-rds-endpoint.ap-east-1.rds.amazonaws.com \
-u admin \
-p \
--single-transaction \
--routines \
--triggers \
--databases your_database_name \
> db_export.sql
# Compress for transfer
gzip db_export.sqlTransfer to Hong Kong VPS
scp db_export.sql.gz root@YOUR_HK_VPS_IP:/tmp/Import to New MySQL Instance
ssh root@YOUR_HK_VPS_IP
# Create database
mysql -u root -p -e "CREATE DATABASE your_database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
# Import
gunzip -c /tmp/db_export.sql.gz | mysql -u root -p your_database_name
# Verify record counts
mysql -u root -p -e "SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema='your_database_name';"Set Up Continuous Replication (for Zero-Downtime Cutover)
For production databases, set up MySQL binary log replication from RDS to your new server during the migration period, then cut over with only seconds of downtime:
# Enable binlog replication from RDS
# (requires REPLICATION CLIENT privilege on RDS)
CHANGE MASTER TO
MASTER_HOST='your-rds-endpoint.ap-east-1.rds.amazonaws.com',
MASTER_USER='replication_user',
MASTER_PASSWORD='password',
MASTER_LOG_FILE='mysql-bin.000001',
MASTER_LOG_POS=0;
START SLAVE;Step 3: Migrate Application Files and Code
# Sync application files from EC2 to VPS
rsync -avz --progress \
ec2-user@YOUR_EC2_IP:/var/www/yourapp/ \
root@YOUR_HK_VPS_IP:/var/www/yourapp/Update your application’s configuration files to point to the new database host (localhost instead of the RDS endpoint), new Redis host, and any environment-specific settings.
Step 4: Migrate S3 Storage to MinIO or Cloudflare R2
Option A: MinIO on VPS (Full Self-Hosted)
# Install MinIO
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
mv minio /usr/local/bin/
# Configure and start
MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=StrongPassword123 \
minio server /data/minio --console-address ":9001" &
# Sync S3 bucket to MinIO using mc
mc alias set aws s3.amazonaws.com YOUR_ACCESS_KEY YOUR_SECRET_KEY
mc alias set local http://localhost:9000 admin StrongPassword123
mc mirror aws/your-s3-bucket local/your-bucketOption B: Cloudflare R2 (Zero Egress Cost)
Cloudflare R2 is S3-compatible with zero egress fees — cheaper than S3 for high-download workloads. Update your application to use R2 endpoint credentials instead of AWS S3 credentials. The AWS SDK works without modification — just change the endpoint URL.
Step 5: Configure Nginx and Test
# Configure Nginx for your application
# (Reference the WordPress guide for detailed Nginx config)
# Install SSL certificate
certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Test application on new server using /etc/hosts override
echo "YOUR_HK_VPS_IP yourdomain.com" >> /etc/hosts
# Access yourdomain.com in browser — it should hit your new serverStep 6: DNS Cutover (Zero-Downtime)
24 hours before cutover:
# Lower DNS TTL to 300 seconds via your DNS provider (Route 53 or Cloudflare)
# This ensures fast propagation at cutover timeAt cutover time:
- Stop writes to the old server (maintenance mode in your application)
- Verify database replication is caught up:
SHOW SLAVE STATUS\G— checkSeconds_Behind_Master: 0 - Stop replication and promote VPS MySQL as the new primary
- Update DNS A record to point to your HK VPS IP
- Disable maintenance mode on the new server
- Monitor error rates for 30 minutes
DNS change propagates within 5 minutes with a 300-second TTL. Total user-visible downtime: typically under 60 seconds.
Step 7: Decommission AWS Resources
After 48–72 hours of stable operation on your new VPS:
- Take a final RDS snapshot for archival purposes
- Stop and then terminate EC2 instances
- Delete RDS instances (ensure final snapshot is retained)
- Empty and delete S3 buckets (after confirming MinIO/R2 migration is complete)
- Release Elastic IPs
- Review and delete unused security groups, VPCs, and IAM roles
# Set up AWS billing alert to catch any forgotten resources
aws cloudwatch put-metric-alarm \
--alarm-name "unexpected-charges" \
--metric-name EstimatedCharges \
--namespace AWS/Billing \
--threshold 10 \
--comparison-operator GreaterThanThreshold \
--alarm-actions YOUR_SNS_TOPIC_ARNPost-Migration: Setting Up Proper Backups
cat > /opt/backup.sh << 'EOF' #!/bin/bash DATE=$(date +%Y%m%d_%H%M%S) BACKUP_DIR="/opt/backups" mkdir -p $BACKUP_DIR # Database backup mysqldump --all-databases | gzip > $BACKUP_DIR/db_$DATE.sql.gz
# Application files backup
tar czf $BACKUP_DIR/app_$DATE.tar.gz /var/www/
# Keep 7 days
find $BACKUP_DIR -mtime +7 -delete
EOF
chmod +x /opt/backup.sh
crontab -l | { cat; echo "0 2 * * * /opt/backup.sh"; } | crontab -Conclusion
Migrating from AWS to a Hong Kong VPS reduces infrastructure costs by 60–80% for typical web application workloads while improving China connectivity through CN2 GIA routing — something AWS ap-east-1 cannot offer. The migration process for an EC2 + RDS + S3 stack takes 1–3 days of work, with a cutover window of under 60 seconds using binary log replication.
The businesses best positioned to benefit are those running standard web applications (PHP, Node.js, Python) on EC2 without deep dependency on AWS-managed services like Lambda or DynamoDB — a configuration that describes the majority of Asia-Pacific SaaS and e-commerce deployments.
Start your migration: Browse Server.HK Hong Kong VPS plans and provision your target server before beginning the migration — the parallel environment lets you test thoroughly before cutting over.