Case Study: Seamless Migration of Alibaba Cloud Services and Kubernetes Cluster to a New Account and Region
This article details a comprehensive, day‑long migration of a WeChat mini‑program's backend—including Kubernetes, RDS, Redis, NAS, CDN and SNAT services—from an Alibaba Cloud A account in Hangzhou to a B account in Beijing, emphasizing pre‑planning, resource optimization, DTS‑based data sync, and zero‑downtime cut‑over.
Background: The company needed to migrate all services of the "Smart Citizen" WeChat mini‑program from Alibaba Cloud A account (Hangzhou) to account B in Beijing region before resource expiration, aiming for a seamless, non‑disruptive cut‑over.
Architecture: Services run on Alibaba Cloud managed Kubernetes, fronted by DNS load‑balancing to two Nginx servers, with DCDN acceleration, MySQL RDS primary‑secondary, Redis 8‑shard cluster, NAS for multimedia, and NAT for outbound traffic.
Resource optimization: Based on monitoring, ECS nodes were downsized to 13 workers, RDS instances reduced to 4‑core/16 GB and 4‑core/8 GB, Redis shards reduced to 4‑shard/8 GB, and NAS consolidated to a single 100 GB volume.
Migration plan – RDS: Used Alibaba Cloud Data Transmission Service (DTS) with structure + full + incremental sync across accounts and regions, including pre‑migration testing and verification.
Migration plan – Redis: Exported RDB files from the source cluster and restored them to the target using RedisShake.
Migration plan – NAS: Synchronized files with rsync + crontab, mounting NAS via NFS in the new Kubernetes cluster.
Kubernetes migration: Exported namespace resources to YAML, cleaned unnecessary fields, updated RDS/Redis endpoints, created PV/PVC definitions, and applied them in the new cluster.
CDN migration: Created new CDN domain in account B, updated deployments, then swapped back to the original domain after cut‑over.
SNAT replacement: Deployed iptables‑based SNAT on a spare ECS and added VPC routing rules.
Timeline: The whole migration was executed within a single day (22 Mar 2020) by one DevOps engineer and two testers, with DNS switch completed in under 30 seconds.
Key tips: Leverage service‑level DNS, perform dual‑round testing, use Kubernetes service abstraction to avoid IP changes, and ensure DTS remains active during DNS propagation.
Conclusion: With thorough preparation, script automation, and Alibaba Cloud DTS, the cross‑account, cross‑region migration was completed smoothly with virtually no impact on end users.
Zhengtong Technical Team
How do 700+ nationwide projects deliver quality service? What inspiring stories lie behind dozens of product lines? Where is the efficient solution for tens of thousands of customer needs each year? This is Zhengtong Digital's technical practice sharing—a bridge connecting engineers and customers!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.