Magento Migration: Move Magento Site to a New Server

Table of Content

Magento mirgation: move your shop to a new server
Last Updated: October 22, 2025

As time moves on and your business grows, there may be a need to move Magento site to another server. For example, you need an upgraded server, or you just don’t like the level of service of your hosting company, or you want to extend your platform functionality with infinite scroll and other add-ons and ensure it performs smoothly. Whatever the reasons of Magento server migration are, moving a functioning store is not the easiest task and you may face various challenges while performing it.

This article describes how to move Magento 2 to another server in detail, and I really hope it’ll help you avoid some typical mistakes of Magento migration to another server.

Why Move Your Magento Site to a New Server

Moving your Magento site to a new server can bring significant benefits in terms of performance, security, and scalability. Over time, your current hosting environment may no longer meet the growing demands of your e-commerce store, especially as traffic, product catalog size, and order volume increase.

Magento migration service from Amasty

Key reasons to consider migrating include:

  • Improved Performance: Upgrading to a more powerful server can reduce page load times, improve checkout speed, and enhance overall user experience.

  • Better Security: Modern servers often come with updated security configurations, firewalls, and monitoring tools that help protect sensitive customer and payment data

  • Scalability: A new server can provide the resources needed to handle spikes in traffic, large catalogs, or multi-store setups without compromising performance.

  • Advanced Features: Many newer hosting environments support caching systems, CDNs, and optimized PHP and database configurations specifically for Magento 2, which can dramatically boost site speed and reliability.

  • Cost Efficiency: Moving to a server that better matches your store’s needs can sometimes reduce hosting costs while providing more resources.

Moving Magento site to a new server ensures your store remains fast, secure, and capable of supporting business growth, ultimately enhancing both customer experience and operational efficiency.

How to Choose a New Magento Host

A good host ensures fast page load times, reliable uptime, and seamless operation, which directly impacts customer experience and conversion rates.

So, when choosing a Magento host, pay attention to the following: 

  • Ensure the host is compatible with Magento 2 system requirements, including PHP version, MySQL/MariaDB, Elasticsearch, and necessary PHP extensions.

  • Look for servers optimized for Magento with fast SSD storage, caching mechanisms (Redis/Varnish), and CDN support to reduce load times.

  • Choose a host that can easily scale resources such as CPU, RAM, and storage as your business grows or during traffic spikes.

  • Check for SSL support, firewalls, malware scanning, regular backups, and server-level security to protect customer data and comply with PCI standards.

  • Prioritize hosts with high uptime guarantees (99.9% or higher) and strong monitoring to prevent downtime.

  • Compare pricing plans to see if they match the resources and features offered, including support, backups, and additional services.

By carefully evaluating these factors, you can choose a hosting provider that supports your Magento store’s growth, ensures a seamless shopping experience for customers, and minimizes technical issues.

6 Stages of Magento Store Server Migration

1. Prepare to move Magento site

Before doing anything, go and check if the new server suits the minimal Magento requirements. It is possible you may need to set up your PHP or install the extensions missing. Also, make sure you have enough disk space on the new server; it should be okay to store the whole shop plus you need some spare space.

2. Make a Magento store backup and copy

We always warn our clients so they won’t make rush decisions. Remember: always test your changes so they won’t harm your Magento shop or interrupt the cash flow.

Switch the domain to the new server only when you’re absolutely sure the shop is working just fine (and you’ll need to sync the data before the final switch).

We have already checked our new server and made sure it suits all the requirements, and now we are ready to move on!

Create a website and a database for your Magento shop.

After that create a backup copy for files and the database. To make the size of the backup copy smaller, exclude var/cache, var/full_page_cache, var/log, var/report, var/session.

[php]cd /home/mageold/public_html
tar -czf ~/magento-files.tar.gz --exclude=var/cache --exclude=var/full_page_cache
--exclude=var/log --exclude=var/report --exclude=var/session .
mysqldump -h localhost -u mageold_magento -p mageold_magento | gzip >
~/magento-db.sql.gz[/php]

Use a convenient way to transfer the backup files to the new server. We suggest SCP:

[php]scp ~/magento-files.tar.gz ~/magento-db.sql.gz magenew@newhost:
[/php]

Now you need to unpack the backup copy on the new server:

[php]tar -xzf ~/magento-files.tar.gz -C /home/magenew/public_html
gzip -dc ~/magento-db.sql.gz | mysql -h localhost -u magenew_magento -p
magenew_magento[/php]

3. Install the transferred Magento backup files

Edit app/etc/local.xml and add the new database settings to it. If you need that, change access permissions. There are two variants:

  1. The web server runs scripts on behalf of the user which is the owner of the files (magenew)

  2. The web server runs scripts on behalf of a separate user (www-data)

For variant 1 you need to set the permissions like this:

[php]find /home/magenew/public_html -type f -print0 | xargs -r0 chmod 640
find /home/magenew/public_html -type d -print0 | xargs -r0 chmod 750[/php]

Allow the web server to save the files it doesn’t own for the second variant:

[php]find /home/magenew/public_html -type f -print0 | xargs -r0 chmod 644
find /home/magenew/public_html -type d -print0 | xargs -r0 chmod 755
chmod -R a+w /home/magenew/public_html/{app/etc,media,var,includes}[/php]

4. Test your moved Magento store

As your domain is still pointing at the old server, add this line to the hosts file (/etc/hosts for unix-like systems and %SYSTEMROOT%\system32\drivers\etc\hosts for Windows-like ones):

[php]1.2.3.4 yourdomain.com[/php]

Where 1.2.3.4 is your new server IP address and yourdomain.com is the domain attached to your Magento shop. Don’t forget to delete this line from the hosts file after the test.

Now it’s time for a big test! Carefully check how the transferred shop is working. Imitate users’ behavior to check if the process of shopping is going smoothly. This is the crucial step of migrating to the new server.

5. Sync data before full Magento server migration

If you didn’t find any errors on the previous step or fixed them all, it’s time to sync your data. Please keep in mind these two important points while completing the process of moving Magento to a new server:

  • DNS settings can’t be updated instantly, so switch your domain TTL time for the smallest available beforehand. Don’t start the final stage of migrating before the old TTL time expires.

  • While you sync your data, the shop on your old server should be off.

To switch the old store server off, turn cron off and enable maintenance mode at touch /home/mageold/public_html/maintenance.flag.

Now it’s time to sync the data. To speed the process we advise to use rsync.

[php]rsync -avz --delete -exclude=var/cache --exclude=var/full_page_cache 
--exclude=var/log --exclude=var/report --exclude=var/session
--exclude=app/etc/local.xml
/home/mageold/public_html/ magenew@newhost:/home/magenew/public_html/
mysqldump --add-drop-table -h localhost -u mageold_magento -p mageold_magento
| gzip >
~/magento-db.sql.gz
scp ~/magento-db.sql.gz magenew@newhost:[/php]

Now upload the database to the new server.

[php]gzip -dc ~/magento-db.sql.gz | mysql -h localhost -u magenew_magento -p 
magenew_magento[/php]

Access permissions may be changed during the synchronization – make sure you check or restore them.
Clear Magento cache:

[php]rm -fr /home/magenew/public_html/var/{cache,full_page_cache,log,report,session}
[/php]

6. Turn cron tasks on and change DNS setting

Almost done! Turn cron tasks on for the new server and change DNS setting so the domain points to the new server. As TLL time expires, traffic will be directed to the new server.

Please note that the old shop must be turned off starting from this point! This backup copy is your so-called insurance you can make use of in case of unexpected circumstances.

Magento 2 Server Migration Tips

Migrating your Magento 2 store to a new server can improve performance, scalability, and security—but it requires careful planning. Here are key tips to ensure a smooth Magento 2 server migration:

  • Take Complete Backups: Back up your database, media files, themes, extensions, and custom code before starting the server migration, and store backups in a secure location in case rollback is needed.

  • Use a Staging Environment: Test the migration on a staging server first to identify and fix potential issues without affecting live customers.

  • Check Server Compatibility: Ensure the new server meets Magento 2 system requirements: PHP version, database, Elasticsearch, and necessary PHP extensions.

  • Preserve URL Structure and SEO: Keep URL rewrites, redirects, and canonical tags intact to avoid losing search engine rankings and organic traffic.

  • Reconfigure SSL and Security Settings: Install or transfer SSL certificates, update firewalls, and verify permissions to maintain site security.

  • Test Cron Jobs and Email Functionality: Verify that cron jobs, email notifications, and scheduled tasks are working correctly on the new server.

  • Optimize Performance: Enable caching, Varnish, and other performance features, and ensure the database is optimized for fast queries.

  • Minimize Downtime: Schedule the Magento server migration during off-peak hours and consider putting the store in maintenance mode to avoid customer disruption.

  • Validate Post-Migration: Test frontend and backend functionality, including checkout, payment gateways, and admin operations, before fully going live.

Potential Challenges in Magento 2 Server Migration

Migrating a Magento 2 store to a new server can improve performance and scalability, but it also comes with potential challenges that must be carefully managed to avoid downtime or data loss.

1. Data Integrity Issues

Transferring large databases, product catalogs, customer records, and order histories can lead to data corruption if not handled correctly. Ensuring proper backup and verification processes is essential.

2. Downtime During Migration

Even a brief period of downtime can result in lost sales or frustrated customers. Coordinating Magento 2 server migration during off-peak hours and using staging environments helps minimize disruptions.

3. Compatibility and Configuration Differences

New servers may have different PHP versions, database configurations, or caching mechanisms. These differences can cause extensions, themes, or customizations to break if not properly tested.

4. SSL and Security Settings

Migrating a site may require reconfiguring SSL certificates, firewalls, and other security settings. Failure to do so can compromise data security or lead to broken HTTPS connections.

5. URL Structure and SEO

Improper migration may affect URL rewrites, redirects, or canonical tags, leading to SEO issues and loss of organic traffic. Careful planning ensures search engines index the site correctly post-migration.

6. Email and Cron Jobs

Email notifications, cron jobs, and scheduled tasks may not function properly if configuration changes aren’t applied during Magento server migration. Testing these processes on the new server is critical.

7. Performance Tuning

Even after migration, the new server may require performance optimization such as enabling caching, configuring Varnish, or adjusting database indexes to achieve optimal site speed.

By anticipating these challenges and following a structured migration plan, Magento 2 store owners can ensure a smooth transition with minimal disruption and maintain full site functionality.

Have you ever transferred your Magento store to a new server? Welcome to share your experience in comments. If you're still afraid to switch to a new server yourself, drop us a line, and we'll be happy to help you!

Magento migration service from Amasty

Frequently Asked Questions

Magento migration is the process of upgrading or moving a Magento store from one version to another (e.g., Magento 1 to Magento 2) or transferring it to a new server or platform. Migration involves moving products, customers, orders, extensions, and customizations while ensuring the store remains fully functional and optimized for performance.

A CDN (Content Delivery Network) in Magento 2 is a network of servers distributed across different locations that deliver static content (images, CSS, JavaScript) to users from the nearest server. This reduces page load times, improves performance for global visitors, and reduces the load on the main server.

To deploy Magento 2 on a server:

  1. Ensure your server meets Magento 2’s system requirements.

  2. Upload the Magento 2 files to the server.

  3. Set proper file permissions for security.

  4. Configure the database and environment settings.

  5. Run the Magento setup and compilation commands.

  6. Clear caches and test the website to ensure full functionality.

Magento 2 requires:

  • Operating System: Linux x86-64 (Ubuntu, CentOS, Debian, etc.)

  • Web Server: Apache 2.4 or Nginx 1.x

  • Database: MySQL 8.0 or MariaDB 10.x

  • PHP: Version 8.1 or 8.2 with required extensions

  • Memory: At least 2GB RAM (4GB+ recommended for production)

  • SSL Certificate: Required for HTTPS

  • Optional: Redis, Varnish, or Elasticsearch for caching and search performance

Originally published: October 22, 2025
October 23, 2025
September 25, 2025
Comments
Anastasia
May 21, 2015
Hello, I followed your steps and moved my Magento eshop to new server. Via the hosts file everything is working correctly , except that when I add a product to cart every page is a blank page. If I clear the cache, everything is back to normal. Have you ever encountered this problem? Regards, Anastasia
Reply
Ksenia Dobreva
May 21, 2015
Hi Anastasia, to know what exactly causes a blank page you need to check your server and Magento logs and to look for errors - you'll have more information then.
Anastasia
May 21, 2015
Hello Ksenia, I checked the logs but nothing it doesn't show anything regarding this error. Also another interesting thing.. I checked my eshop through this https://hosts.cx/ and everything is working correctly apart from the following: I add a product to the cart, product added successfully to cart. As long as I stay on the same page I can see my cart that has one product. When I navigate to another page the cart is empty. Also no errors is written either in the logs or in the console of the browser.
Ksenia Dobreva
May 22, 2015
Hey Anastasia, please check your email!
Billy Ross
February 10, 2016
Hi, I have moved my Magento shop to a new server before few days ago by following your procedure which you have mentioned above and i want to say that everything is working really well. So, want to say thanks to you for this useful information and please keep it up.
Reply
Ksenia Dobreva
February 10, 2016
Hi Billy, thanks for your comment, we're really glad the article was helpful for you!
Peter Maskolin
March 14, 2016
Hello I have finally move the my magento eshop for new server and everything is working correctly, Thanks
Reply
Ksenia Dobreva
March 14, 2016
Great! Glad the article was useful for you.
Robert Williams
June 22, 2016
Great article Ksenia. I successfully migrated my Magento website using your tips for which I can't thank you enough. I won't have to bother Rosehosting about migration now. Cheers.
Reply
Ksenia Dobreva
June 27, 2016
Hey Robert, thanks for reading! We're delighted that the article was helpful for you =)
Peter Miller
December 16, 2019
Hello I have finally move the my magento eshop . This blog has helped in understanding the points to consider while choosing to a new server. Thank you for sharing such important information.
Reply
Polina Litreyeva
December 20, 2019
Hi, Peter! Thanks for your feedback! We are glad that our blog is helpful to you.
saket
March 27, 2020
I m trying to do so with my magenta store but I don't know why its showing me 500 internal server error
Reply
Polina Litreyeva
March 30, 2020
Hi, Saket! Thanks for reading and for the question. Pity you’ve come up with the issue. You see, the question needs professional assistance with deeper insights into the system itself, as long as there are multiple reasons why the issue could occur in your store. Sorry but that is why we won’t help you in the comments. You can check the <a href="https://amasty.com/knowledge-base/how-to-fix-error-500-in-magento-2.html">article in our knowledge base</a> or <a href="https://amasty.com/magento-1-to-2-migration-service.html">contact us</a>, and we will help you with migration. Cheers!
Leave your comment

Your email address will not be published

This blog was created with Amasty Blog Pro

This blog was created with Amasty Blog Pro

Loading