Moving the website to a new server is one of the most sensitive tasks that a site administrator does; Because a small mistake can lead to site downtime, data loss or SEO ranking drop. Fortunately, with a regular program and observing the correct sequence of steps, the site can be transferred to the new server without a single moment of downtime for users. In this practical guide, you will learn step-by-step how to do this with minimal risk.
The reasons for migrating are varied: maybe your current server is slow, maybe you need more resources, or maybe you're not satisfied with the quality of support from your current provider. Whatever your reason, this article aims to turn migration from a stressful nightmare into a manageable and safe process.
Why does website migration need planning?
Site migration is not just "copying files from one place to another". A live site includes files, databases, domain settings, SSL certificates, and server configurations that all need to be migrated in sync. If any of these components are missing or misconfigured, the site will either not work or the data will be incomplete.
More important is the issue of timing. If you don't do the migration correctly, visitors may end up with an incomplete or empty version of the site during the migration. The secret of uninterrupted migration is that the old site remains active until the moment of complete certainty of the correctness of the new site.
Golden Tip: Never delete the old site before fully verifying the authenticity of the new site. The old site is your safety net.
Step 1: Make a full backup
The first and most important step is to take a complete backup of everything. This is your safety net against any unexpected events. The backup should include the following:
- All site files (main files, images, templates and plugins).
- Complete database.
- Server and web server configuration files.
- Email settings, if any.
To backup files and database on a Linux server, you can use the following commands:
# فشردهسازی فایلهای سایت
tar -czvf website_backup.tar.gz /var/www/yoursite
# گرفتن خروجی از پایگاهداده
mysqldump -u root -p your_database > database_backup.sql
Step 2: Prepare the new server
Before migration, the new server must be fully prepared. This means installing the same software stack (web server, database and compatible PHP version) that your site needs. If the PHP version or the database of the new server is very different from the old one, the site may have an error.
اگر هنوز سرور جدید تهیه نکردهاید، میتوانید از طریق خرید سرور مجازی با منابع متناسب یا بیشتر از سرور فعلی اقدام کنید. توصیه میشود سرور جدید حداقل به اندازهٔ سرور قدیمی منابع داشته باشد تا با افت عملکرد مواجه نشوید.
Software version synchronization
Before migration, note down the exact software version of the old server and install the same on the new server. This simple table will help you not miss anything:
| component | old server | New server |
|---|---|---|
| PHP version | make a note | Must be identical or compatible |
| Web server (Nginx/Apache) | make a note | Preferably the same |
| database | make a note | Compatible version |
| PHP plugins | List it | Install all |
Step 3: Transfer files and database
Now it's time to transfer data. Transfer the backup files to the new server. One of the most secure methods is to use rsync or scp:
# انتقال فایل بکاپ به سرور جدید
scp website_backup.tar.gz root@NEW_SERVER_IP:/var/www/
# در سرور جدید، استخراج فایلها
tar -xzvf website_backup.tar.gz
Then restore the database to the new server:
# در سرور جدید، ابتدا پایگاهداده را بسازید سپس بازیابی کنید
mysql -u root -p your_database < database_backup.sql
After the migration, edit the site configuration file so that the database connection information (username, password, and database name) matches the new server settings.
Step 4: Full test of the site on the new server
This step is done before changing the domain and is very critical. You need to make sure the site is working perfectly on the new server without changing the domain yet. For this, you can temporarily point the domain to the new server IP by editing the hosts file on your computer:
# در فایل hosts سیستم خود این خط را اضافه کنید
NEW_SERVER_IP yourdomain.com
Now check the site completely: home page, internal pages, forms, user login, management section and the purchase process in stores. Fix any problem right here. The advantage of this method is that only you see the new version and the users are still on the old server.
Tip: Make a checklist of all the important pages and functions of the site and test each one on the new server. Discovering the problem before changing the domain is a thousand times better than discovering it after the outage.
Step 5: Change DNS and manage release time
When you are sure that the new site is completely correct, it is time to change the DNS so that the domain points to the new server. There is an important point here: DNS changes are not immediately applied worldwide, and this process is called propagation, which may take several hours.
Reduce TTL before migration
To make the propagation faster, reduce the TTL value of the DNS records (for example, to 300 seconds) a few days before the migration. This will make the DNS servers receive the new record sooner and the transfer window will be shorter.
Because the old and new sites are both active and have the same content in this period, users will not feel any difference when they see each one and there will be no outage. That is why we emphasized not to delete the old site too soon.
Step 6: Final review and SEO assurance
After the DNS release is complete, check these things to make sure everything is correct:
- The SSL certificate is installed and active on the new server and the site opens with HTTPS.
- All important redirects and addresses are working properly.
- Forms, emails and payment gateway have been tested.
- The robots.txt file and the sitemap are set correctly.
- Monitor the new server and site performance in webmaster tools.
If you have not changed the address of the pages and the site structure remains the same, the migration will not have any negative impact on SEO. For more information about infrastructure and optimization, see Rapido Server Articles. If you need a new domain, proceed through domain registration.
Migration of different types of sites
The general migration process is similar for all sites, but depending on the type of site, there are specific points that you should pay attention to. In the following, we point out the differences in the migration of some common types of sites.
WordPress site migration
For WordPress sites, in addition to transferring files and databases, you should pay special attention to the wp-config.php configuration file, where the database connection information is located. Also, if the site address changes, you should also update the addresses stored in the database. Fortunately, WordPress migration plugins automate many of these tasks and simplify the process.
Online store migration
Online stores have the most sensitive type of migration, as order, customer and inventory data is constantly changing. The best thing to do is to perform the migration at an hour with the least traffic and, if possible, temporarily stop the registration of new orders so that no data is lost between the two servers. After migration, be sure to test the complete purchase process and payment gateway connection.
Migration of custom coded sites
For sites written with custom frameworks, you'll need to make sure all required dependencies and libraries are installed on the new server. Environment variables, configuration files and programming language version must be configured exactly according to the old server in order for the site to run without errors.
Right time to migrate
Choosing the right time to migrate is as important as the process itself. The best time is when your site traffic is at its lowest; Usually midnight or early morning. By choosing this interval, even if a small problem occurs, the least number of users will be affected.
It is also better to perform the migration on days when you and the technical team are available so that you can react quickly if a problem occurs. Migration right before an important event such as a sales campaign or the release of an advertising campaign is high risk and not recommended; Let the new site prove its stability for a few days first.
Common mistakes in site migration
Even experienced people sometimes make mistakes in immigration. Knowing these common mistakes will help you avoid them:
- Not taking a full backup: The biggest possible mistake; Without backup, any mistake can be catastrophic.
- Premature removal of the old site: Never remove the old server before you are completely sure of the new site.
- Forgot to set up SSL: If the SSL certificate is not enabled on the new server, the site will be displayed as insecure.
- Ignore version incompatibilities: PHP or database version differences can crash the site.
- Not testing before DNS change: Discovering the problem after domain change means outage for users.
Note: prepare a written plan for migration and check the steps one by one. Planned migration is much less risky than impromptu migration.
Post-migration: monitoring and optimization
The migration does not end with the DNS change. In the first few days after the transfer, you should monitor the site closely to make sure everything is stable. Check server performance, page load speed, and error logs to identify potential problems early.
This is a good opportunity to take advantage of the new server features. If you have moved to a more powerful infrastructure, you can optimize the cache settings, upgrade the software version and increase the speed of the site from what it was on the previous server. A successful migration is not only a smooth transition, but also an opportunity to improve overall site performance.
In the first days, keep an eye on traffic statistics and user behavior to make sure that no page has errors and that all internal and external links are working properly. If you are using webmaster tools, check that the search engines are reading the new site pages without problems and that the crawl error is not reported. This close monitoring during the first week will give you peace of mind about the complete success of the migration.
summary
The migration of the website to the new server, despite the high sensitivity, can be done without interruption; Provided you go with the plan. The key to success boils down to a few simple principles: full backup before doing anything, careful preparation of the new server, full testing before changing DNS, reducing TTL for faster publishing and most importantly, keeping the old site to 100% certainty. By following these steps, you can safely migrate to a better infrastructure without a single user noticing the outage.
Frequently asked questions
Does site migration cause a drop in SEO?
If the migration is done correctly and the URL structure of the pages and content remain unchanged, no rank loss will occur. SEO problems usually occur when page addresses change and redirects are not set up correctly, or the site experiences a long outage during the migration.
How long does it take for DNS changes to take effect?
DNS propagation usually takes a few minutes to a few hours, and in rare cases it can take up to 24 hours. To speed up this process, reduce the TTL value of the records a few days before the migration so that the DNS servers can receive the new record sooner.
How can I make sure that my site will not be interrupted during the migration?
The trick is to keep the old site active until you are completely sure that the new site is correct. By testing the new site through the hosts file before changing DNS, and not deleting the old site, a healthy version of the site is always available to users throughout the transfer.
Can I do the migration myself or do I need a specialist?
If you are familiar with basic Linux server and command line concepts, you can do the migration yourself by following a step-by-step guide. But for large, complex, or mission-critical sites, enlisting the help of an expert or provider's support team can reduce the risk.



