How to Migrate Your Website to AWS Without Downtime
How to migrate your website to AWS is a project that sounds technical, but it follows a clear sequence: copy the site, test it on AWS, point your domain at the new home, and switch off the old host. Done in that order, with the right preparation, your visitors will never notice the move.
Businesses move to AWS for good reasons: faster loading, room to grow, and control over the server that shared hosting cannot offer. A site that slows down every time traffic spikes, or a host that cannot run the software you need, are both signs the move is worth making.
The moves that go wrong almost always go wrong in the same two places: DNS and SSL. Change the domain records at the wrong moment, or let the security certificate lapse during the switch, and your site goes dark even though the files moved perfectly. This guide puts those two steps in the right order.
Here is the short answer. Set up the site on AWS first, usually on EC2 or Lightsail, copy the files and database, test it on a temporary address, then update DNS with a low time-to-live and install the SSL certificate before the switch. Keep the old host running for a week as a safety net.
The rest of this guide walks through each stage in order, including the Cloudflare-in-front-of-AWS pattern that makes the migration safer. Follow the sequence, keep a checklist, and treat the old host as your backup until you are sure the new site works.
Key Takeaways
Migrate in order: build on AWS, copy files and database, test on a temporary address, then switch DNS.
DNS and SSL sequencing causes most migration downtime: lower TTL first, and install the certificate before the switch.
Cloudflare in front of AWS is the safer pattern: it hides your server, adds caching, and lets you switch traffic instantly.
WordPress migrations need the database and the uploads folder both copied, plus a search-and-replace for the old domain.
Keep the old host live for a week after the switch, and roll back by changing DNS if anything breaks.
Before You Start: Plan the Move
A migration starts with an inventory, not a server. Write down what your site is made of: the platform, the theme or template, the plugins or extensions, the database, and any email accounts tied to the domain. Email is the part people forget, and losing it is worse than losing the website.
Choose the AWS service before you build anything. Lightsail is the simplest option for a small WordPress site: a fixed monthly price, a pre-built WordPress image, and a console that hides most of the complexity. EC2 gives more control and more room to grow, but it needs more setup and more maintenance.
Lightsail or EC2: Which Fits Your Site?
Lightsail suits a small business site, a blog or a brochure site that needs predictable cost and a simple setup. You pick a plan, launch a WordPress instance, and you have a working server in minutes. It is the closest AWS comes to shared hosting, with far more headroom.
EC2 suits larger sites, custom applications, or teams that want to choose every part of the stack. You pick the instance size, the operating system and the software, and you scale it up when traffic grows. The trade-off is that you manage updates, backups and security yourself, or hire someone who does.
Copying Files and the Database
With the AWS server ready, the next step is copying the site. For WordPress, that means two things: the files, including the uploads folder with every image, and the database, which holds the posts, pages, settings and user accounts. One without the other is a broken site.
The reliable way is to export a full backup from the old host and import it on the new server. Migration plugins such as UpdraftPlus, All-in-One WP Migration or Duplicator automate this, and they handle the search-and-replace that changes the old domain to the new one inside the database.
For a large site, a manual copy over SFTP and a database export can be faster and more predictable.
Common Copy Mistakes to Avoid
The most common mistake is copying the files but not the database, or the database but not the uploads folder. Both look like a finished migration until someone opens a page and finds missing images or an empty blog. Check the media library and a few old posts, not just the homepage.
DNS and SSL Sequencing: The Step That Causes Downtime
Here is the gap most guides skip, and it is the one that takes sites offline. DNS is the system that turns your domain name into a server address, and every DNS record has a time-to-live, or TTL, that tells the internet how long to cache it.
If your TTL is a day, a change can take a day to reach everyone.
Lower the TTL to five minutes at least two days before the migration, so the old value expires everywhere before you switch. Then, when you update the A record to point at the AWS server, the change spreads in minutes instead of hours.
Skip this step and half your visitors will reach the old server long after you thought the move was done.
SSL is the second half of the sequence. Your certificate proves your site is who it claims to be, and browsers show a warning if it is missing or invalid.
Install and test the certificate on AWS before you switch DNS, using a temporary hostname or the Cloudflare setup below, so the first visitor after the switch sees a secure site.
The Safe DNS Switch, in Order
First, lower the TTL and wait for the old value to expire. Second, install the SSL certificate on the new server and test it on the temporary address.
Third, update the A record to the AWS address and watch the site load over HTTPS. Fourth, keep the old host running for a week, so you can switch DNS back in minutes if anything breaks.
Cloudflare in Front of AWS: The Safer Pattern
Few guides explain this pattern, but it makes migrations far safer. Cloudflare sits between your visitors and your AWS server: visitors reach Cloudflare, and Cloudflare fetches the site from AWS. Your server’s real address stays hidden, which cuts down on direct attacks and bot traffic.
For a migration, Cloudflare gives you a switch you can flip. Point Cloudflare at the new AWS server, and traffic moves instantly when you are ready. If something breaks, point it back at the old host just as fast.
There is no waiting for DNS to spread, because the DNS record points at Cloudflare, and Cloudflare decides where the traffic goes.
Setting Up Cloudflare for the Migration
Create a Cloudflare account, add your domain, and let it scan your existing DNS records. Check the scan carefully: it should find your website record, your mail records and any subdomains. A missing mail record is the mistake that breaks email during a migration, and it is easy to miss.
Set the website record to proxy through Cloudflare, then update your domain’s nameservers to Cloudflare’s at your registrar. Wait for the change to take effect, confirm the site still loads, and only then begin the AWS move. With Cloudflare in place, the AWS switch itself becomes a single setting change.
Step
What to do
Common mistake
Inventory
List platform, plugins, database, email
Forgetting email accounts
Choose service
Lightsail for small sites, EC2 for larger
Picking EC2 for a simple blog
Copy site
Files plus database, then test
Copying files without the database
Lower TTL
Set TTL to 5 minutes, 48 hours early
Switching with a 24-hour TTL
Install SSL
Certificate on AWS before the switch
Switching DNS before SSL works
Switch DNS
Point A record at AWS or Cloudflare
Cancelling the old host the same day
Verify
Test pages, forms, speed, email
Checking only the homepage
WordPress to AWS: The Practical Details
WordPress is the most common migration to AWS, and it has a few quirks worth knowing. The uploads folder holds every image you have ever added, and it is often the largest part of the site. Copy it completely, and check the media library afterwards for broken thumbnails, which signal a partial copy.
Testing the New Site Properly
Test more than the homepage. Open five different pages, including an old blog post and a page with a form. Submit the form and confirm the message arrives. Log in to the admin area, publish a test post, then delete it. Check the site on a phone, because mobile visitors often see different problems.
Migration Checklist: Your Move-Day Plan
Use this checklist on move day, in order, so nothing is skipped in the rush. Print it or keep it open on a second screen while you work.
Confirm the full backup of the old site is downloaded and stored safely.
Confirm the site works on the AWS temporary address, including forms and admin login.
Confirm the TTL was lowered at least 48 hours ago.
Confirm the SSL certificate is installed and valid on the AWS server.
Confirm email records are correct and mail still flows.
Update the A record or the Cloudflare origin to the AWS server.
Test the live site over HTTPS from a phone and a computer.
Keep the old host running for one week, then cancel it only after a clean week.
Frequently Asked Questions
How long does it take to migrate a website to AWS?
A small WordPress site can move in a day, including testing, while a large site with a big database can take several days. The DNS switch itself takes minutes once the TTL is lowered, but the copying and testing should never be rushed.
Will my website go down during migration to AWS?
It should not, if you build and test the site on AWS first and switch DNS only when it works. Most downtime comes from switching DNS before the new site is ready, or from an SSL certificate that is not installed yet. Lower the TTL first and keep the old host running.
Should I use Cloudflare with AWS?
Yes, for most sites. Cloudflare in front of AWS hides your server address, adds caching, and lets you switch traffic between the old and new host instantly. It also provides a free certificate for the visitor-facing connection, though you still need one on the AWS server.
Is Lightsail or EC2 better for WordPress?
Lightsail is better for a small WordPress site because it has a fixed monthly price and a pre-built WordPress image. EC2 is better for larger sites or custom setups where you need to choose the instance size and software yourself.
What happens to my email when I migrate to AWS?
Nothing has to happen to your email if you keep the MX records pointing at your current mail host or a dedicated mail service. Check the records before the move, and test sending and receiving afterwards. Never let a migration change your MX records by accident.
Conclusion
How to migrate your website to AWS is mostly a matter of sequence. Build first, copy carefully, test on a temporary address, lower the TTL, install SSL, and only then switch DNS. Cloudflare in front of AWS makes the switch safer still, because it gives you a control you can flip back.
Keep the old host for a week, test everything twice, and cancel nothing on move day. A migration done in the right order is invisible to your visitors, and that is exactly the point.
Ayesha is the co-founder of occcy and the editor behind its entertainment and lifestyle coverage. She believes good writing should feel like a conversation with a smart friend, clear, warm, and genuinely helpful.