My favorite strategies for moving LARGE WordPress sites from one server (or webhost) to another.
Yes, it’s a pain in a butt and there’s always this scary feeling that maybe something didn’t copy over correctly. Never to fear, this guide is here to assist you with that.
LARGE WordPress site migration
What do I consider a “large site migration”. Pretty much any site that can’t be conveniently moved using a simple backup/migration plugin. Maybe you don’t have enough space to export. Or maybe the database is too big to import. Or maybe because you don’t have convenient enough access. No matter the issue, if you can’t do it in an automated manner, I’ll outline many tactics to get the site over no matter what.
Honestly, moving a large WordPress site isn’t that far off from other site migrations. The only difference is that some steps will have to be broken down into smaller steps to overcome resource limits (usually memory or space, or even access). Before going any further…I will tell you right now that only a developer should be tasked with moving a large WordPress site. Big critical sites should not be moved by someone who lacks experience. Even if you DID move it “successfully”, it might fail later or be missing important data or files.
With that note in mind, I am writing this guide without spelling out every little detail and instruction. It’s a tactical guide only!
Get as much access as you can:
- Nameserver settings – login for your domain registrar
- DNS settings (optional) – if you have Cloudflare or some other DNS service
- WP-admin login – must have to verify settings are working after the move
- Database access – either through phpmyadmin, or use a backup plugin to get it from WordPress backend
- FTP/SFTP access – or use a backup plugin to get the files from WordPress backend
- SSH or command-line access – really helpful if you want the fastest way to send files, but some webhosts don’t allow it
2. DNS preparation
I assume you want to migrate with as little downtime as possible. If so, go to your DNS settings and decrease the TTL for your domain and “www” DNS records down to the lowest setting possible. 2-5 minutes would be ideal. Also, if you’re an ecommerce store and DON’T want people to buy while you’re migrating, you should put your site on maintenance mode.
3. Copy over the files
Moving massive files can be a major pain and suck up a lot of time but actually technically very easy. I would start by backing up just the files using any of the following methods. If one fails, you try the next one.
- If you have access to a WordPress plugin, File Manager tool, SFTP, or the command line…compress all files into an archive. After that, download it or transfer directly to the new web server using rsync. If rsync isn’t available but you have cli, you can try SFTP from the new server to the old and copy it that way as well.
- If you don’t have space on the current server to archive all the files, try archiving only parts of it at a time. I usually do all folders and files EXCEPT the wp-content directory. And then that one, I archive everything EXCEPT the uploads directory. Then for the uploads directory, I separate it into as many archives as needed.
4. Copy over the database
Exporting the database is usually pretty easy, even for large databases. It’s the importing part that can be a pain.
- Export the database via phpmyadmin or a backup plugin. (For large database, use mysql database dump or wp-cli.)
- Then import the database into the new web server using phpmyadmin.
- If you can’t import because it’s too large, try compressing into ZIP format and try again.
- If that also doesn’t work, you can upload the database into the website directory and then import through the command line. Another way is to increase your upload limits and execution times on your new server (if you have access to that).
- If you don’t know how to use the command line, you could try exporting just several tables (via phpmyadmin) at a time instead of the entire database. ORRRRR…you could just use WP Migrate DB Pro plugin.
5. Post-configurations & DNS switch
Once the files and database is copied over, you have to do the usual final checkups and also DNS switch. In some cases if you’re in such a rush to get traffic to the new server ASAP, you switch DNS first. In other cases, you switch DNS last.
- Check wp-config and htaccess or nginx configurations for proper settings.
- Rewrite URL’s in database to match the new WordPress home directory path.
- Switch DNS/nameservers and generate new SSL afterwards. Then put your TTL back to a normal interval.
- Copy over and transactions that might have happened during the migration.
CONGRATS, you’re done!
How do you go about migrating from Host A(Apache)to Host B(Open Litespeed)?
You want Host B to use same domain on Host A.
Host B is running cyberpanel for managing websites.
Walk me through the process please.
What part are you lost on? Have you seen this already? How to migrate ANY type of website (to new webhost)