Moving a live production website from one web hosting server to another — or promoting code changes from a local developer machine through staging into production — is a high-stakes engineering operation. Executed poorly, migrations cause broken image paths, corrupted serialized database settings, missing SSL certificates, and hours of costly commercial downtime. In this master class, we cover the Zero-Downtime Migration Protocol and modern Git CI/CD automated deployment pipelines.
Follow this exact sequence to migrate a live domain with zero disruption to visitors:
Log in to your DNS provider (Cloudflare, Namecheap, GoDaddy). Locate your domain's A-record and lower the TTL (Time To Live) from the default 86400 seconds (24 hours) down to 300 seconds (5 minutes). This ensures that when you finally switch servers, global ISPs will pick up the new IP address within 5 minutes instead of caching the old server for days!
Transfer files via SFTP or command-line rsync. Export the MySQL database using wp db export or phpMyAdmin. Import the database onto the new server, and update wp-config.php with the new host's database credentials.
Never change public DNS blindly without testing! You can force your personal computer to load the domain from the new server's IP address by editing your computer's local hosts file:
C:\Windows\System32\drivers\etc\hosts (Open in Notepad as Administrator)/etc/hosts (sudo nano /etc/hosts)203.0.113.45 veewom.com www.veewom.com
Once verified, remove the hosts file test line, provision a free Let's Encrypt SSL certificate on the new server, and point your public DNS A-Record to the new server's IP address. Traffic will switch seamlessly with zero dropped packets!
Agency teams never edit code live on production servers via FTP. Instead, they track theme and plugin code inside a GitHub repository and deploy automatically via GitHub Actions:
# .github/workflows/deploy.yml - Automated SFTP Deployment on Git Push
name: Deploy Theme to Production
on:
push:
branches: [ main ]
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Sync Theme Files via SFTP
uses: SamKirkland/FTP-Deploy-Action@4.3.3
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./
server-dir: /public_html/wp-content/themes/veewom-theme/
Whenever a developer pushes code to the main branch on GitHub, the pipeline runs automated code linter tests and pushes only modified files to the production server in seconds!
In web engineering exams: Never commit the entire WordPress core or wp-config.php into a public Git repository (which would expose database passwords!). Always commit only your bespoke custom theme (/wp-content/themes/my-theme/) or custom plugin directory.
Expand your CMS mastery by studying these tightly integrated WordPress development topics:
Create full snapshots before initiating domain or web host migrations.
Update database serialized URLs accurately using wp search-replace.
Configure server caching and DNS routing on your new hosting server.
Verify SSL certificates, file permissions, and firewall rules on launch.