Server Migration: How to Move and Not Break Anything?
Hello, friends!
Today, I would like to discuss an important moment in the life of almost every company that owns a server: migration.
Migration is something many people try to avoid and truly fear. It’s understandable—moving a website is like moving to a new house: you can always forget something or break it in the process. Additionally, it takes time, and no one wants their site to be down for 5 minutes, let alone several hours.
So, how do you handle a migration and avoid Downtime? Today, we will break down this question so you won't have to worry in the future if you need to "transport" your project.
Preparing for Migration: Where to Start?
Before you begin the transfer, you need to conduct an audit. Here are three critical points:
Software Versions. Are the versions of PHP and MySQL/MariaDB the same on both servers? If the old one runs PHP 7.4 and the new one runs 8.3, it could lead to serious errors. Ensure the versions are identical.
Disk Space. It is important to understand that archives will take up double the space during the transfer. Always choose a server with extra room so you don't run out of space at the most critical moment.
Access Permissions. You need Sudo rights to perform all necessary manipulations yourself. Some hosters provide limited access, which complicates the work. Of course, providers can help with the migration, but this is usually a paid service.
Safety First: How to Play It Safe?
A backup is the most reliable solution during a migration. By making a full backup, you completely protect yourself from data loss and unnecessary stress. If something goes wrong, you will always have a rollback point.
Technical Magic: Moving Without Downtime
The Secret Ingredient: Lowering the TTL
This is what beginners forget most often, and then they wait a whole day for the site to "move." 24 hours before the migration, go to your domain's DNS settings and find the TTL (Time To Live) parameter. Usually, it is set to 3600 or 84600. Change it to 300 (5 minutes).
Why is this necessary? Once you update to the new IP, providers worldwide will learn about it in 5 minutes instead of a full day. This is the key to moving without downtime.
Transferring Files: Forget About FTP
If your site has thousands of images, transferring them via FileZilla is torture. The connection might drop, and you’ll get confused about what was copied and what wasn't. For pros, there is the rsync command. It works via SSH, compresses data, and if the connection drops, it simply resumes where it left off.
Example command: rsync -avz -e ssh /var/www/html/ user@new_IP:/var/www/html/Database: "Silent" Mode
Before exporting your database, be sure to put the site into Maintenance Mode.
Why is this critical? If a customer buys a product on the old server while you are making the copy, that order will not make it to the new server. It’s better to turn the site off for 10 minutes than to lose customer data.
How to Test the Site Before the World Sees It?
The coolest lifehack is using the hosts file on your personal computer. You can manually map the new server's IP to your domain name.
After doing this, your browser will open the site from the new server, even though it is still running on the old one for everyone else. You can safely check forms, images, and scripts, and only after ensuring everything is perfect do you change the IP in the domain panel.
Final Checklist After the Move
Once the DNS has updated and the site opens from the new server, check the following:
SSL Certificate: Did Let's Encrypt reissue for the new IP?
Email: Are emails still being sent from the site (order notifications or registrations)?
Cron Jobs: Did you remember to transfer the task scheduler?
FAQ: Short and Simple
Do I need to change settings in the CMS? Yes, if the database details (DB name, user, or password) have changed, update them in the configuration file (e.g.,
wp-config.php).What if I get a 500 error on the new server? Most likely, it’s a permissions issue. Try running
chown -R www-data:www-datafor your site folder.Can I migrate from Linux to Windows or vice versa? Technically yes, but it will create many problems with file paths and case sensitivity. Try to use the same OS.
Conclusion
Migration is not a disaster if you have a clear plan and a cool head. The main thing is to always have a fresh backup on hand and not to rush into deleting data from the old server (keep it there for another week as insurance).
If you feel that your project is too complex for a self-migration, you should contact the technical support of the hosting provider you are moving to. For example, we perform free migration to our Shared Hosting when the service is paid for a year in advance.
Article author — Anatolie Cohaniuc

