• Email: [email protected]
  • Dedicated Server Login
  • About
  • 9288041031
  • Knowledge Base
  • Support
India's best web hosting | Ehostpiya India
  • Home
  • Hosting
    Web Hosting Quality Hosting Starting at ₹60/mo
    Cloud VPS Starting at ₹300/mo
    Dedicated Server First Starting at ₹2401/mo
    Reseller Web Hosting Conveniently Starting at ₹421/mo
    Application For Hosting
    • iconWordPress Hosting
    • iconJoomla Hosting
    • iconMagento Hosting
    • iconOpencart Hosting
    • iconPrestashop Hosting
    • iconDrupal Hosting
  • Email
  • Domain
  • SVG
    Contact Us Face any problem contact with us
    SVG
    About Us We are leading hosting company
  • My Account
Web Hosting Blogs by Ehostpiya | Tips and Tricks Web Hosting Blogs by Ehostpiya | Tips and Tricks
Buy Now

Archives

  • October 2026
  • September 2026
  • August 2026
  • October 2023

Categories

  • Control Panels
  • Magento
  • Miscellaneous
  • SEO
  • Technology
  • Trends
  • Web Hosting
  • Wordpress
Facebook Twitter Instagram Pinterest
Home How to Move Magento to a New Domain
ByVandeeta
October 6, 2026

How to Move Magento to a New Domain

Table of Contents

Toggle
  • How to Move Magento to a New Domain
  • Example Domain Migration
  • Why Move a Magento Store to a New Domain?
  • What You Need Before Starting
  • Step 1: Create a Complete Magento Backup
  • Step 2: Prepare the New Domain
  • Step 3: Install SSL for the New Domain
  • Step 4: Add the New Domain to the Web Server
  • Step 5: Check Your Current Magento URLs
  • Step 6: Update Magento Base URLs
  • Step 7: Make Sure HTTPS Is Enabled
  • Step 8: Check for the Old Domain in the Database
  • Step 9: Search the Magento Files for the Old Domain
  • Step 10: Clear Magento Cache
  • Step 11: Clear Generated Data When Necessary
  • Step 12: Reindex Magento
  • Step 13: Configure 301 Redirects From the Old Domain
  • Step 14: Configure Apache Redirects
  • Step 15: Configure Nginx Redirects
  • Step 16: Do Not Redirect the New Domain Back to the Old Domain
  • Step 17: Check Canonical URLs
  • Step 18: Update XML Sitemap
  • Step 19: Update Robots.txt
  • Step 20: Update Google Search Console
  • Step 21: Update Analytics
  • Step 22: Update Third-Party Services
  • Step 23: Update Email Configuration
  • Step 24: Test Customer Accounts
  • Step 25: Test Checkout and Payments
  • Step 26: Check Product Images
  • Step 27: Check Internal Links
  • Step 28: Test the Magento Admin Panel
  • Step 29: Test the Site Before Going Live
      • Frontend
      • Backend
      • Technical
  • Step 30: Monitor the Old Domain
  • Common Magento Domain Migration Problems
    • Redirect Loop
    • Images Still Use the Old Domain
    • Admin Panel Redirects to the Old Domain
    • Checkout Does Not Work
    • Customers Cannot Log In
    • Search Rankings Drop
  • Best Practices for Magento Domain Migration
    • Keep URL Paths the Same
    • Use 301 Redirects
    • Keep the Old Domain Active
    • Back Up Before Changes
    • Test Before Launch
    • Update External Services
    • Monitor After Launch
  • Magento New Domain Migration Checklist
      • Preparation
      • Magento Configuration
      • SEO
      • Integrations
      • Testing
  • Final Thoughts

How to Move Magento to a New Domain

Changing the domain of a Magento store requires more than pointing a new domain to the existing server. Magento stores the website URL in its configuration, and references to the old domain may also exist in the database, cached data, media, emails, redirects, and third-party integrations.

A poorly planned domain migration can result in broken links, redirect loops, missing images, checkout problems, SSL errors, or lost search-engine rankings.

The safest approach is to prepare the new domain, back up the store, update Magento’s base URLs, carefully replace old domain references where necessary, configure redirects, install SSL, test the entire store, and monitor the migration after launch.

This guide explains how to move a Magento store from an old domain to a new domain while minimizing downtime and SEO problems.


Example Domain Migration

Suppose your current Magento store is:

https://oldstore.com

and you want to move it to:

https://newstore.com

The migration will look like this:

Old Domain
oldstore.com
      |
      | Magento Store
      ↓
Update Configuration
      |
      ↓
New Domain
newstore.com
      |
      ↓
301 Redirects
      |
      ↓
Search Engines / Visitors

The old domain should generally remain available so that visitors and search engines can be redirected to the corresponding pages on the new domain.


Why Move a Magento Store to a New Domain?

There are several reasons a business might change its domain:

  • Rebranding
  • Company name change
  • Better domain name
  • International expansion
  • Merging websites
  • Marketing strategy
  • Moving to a new brand
  • Changing from a temporary domain to a permanent domain

Whatever the reason, the migration should be planned as a website move rather than simply changing DNS.


What You Need Before Starting

Before changing the Magento domain, make sure you have access to:

  • Magento Admin Panel
  • Magento server
  • SSH
  • Database
  • DNS management
  • SSL certificate management
  • Web server configuration
  • Search Console accounts
  • Analytics platform
  • CDN or WAF configuration
  • Email configuration

Also create a complete backup before making changes.


Step 1: Create a Complete Magento Backup

Before modifying the domain configuration, back up the store.

Your backup should include:

  • Magento database
  • Magento files
  • Product images
  • Media
  • Custom modules
  • Custom themes
  • Configuration
  • Composer files

A database backup can be created using:

mysqldump -u DB_USER -p DATABASE_NAME > magento-backup.sql

For a compressed backup:

mysqldump -u DB_USER -p DATABASE_NAME | gzip > magento-backup.sql.gz

Keep the backup separate from the production website.

Do not begin the domain migration until you have a verified recovery point.


Step 2: Prepare the New Domain

Register or configure the new domain before changing Magento.

For example:

newstore.com

Configure DNS records to point to the Magento server.

Depending on your setup, you may need records such as:

newstore.com       → Server IP
www.newstore.com   → Server IP

If you use a CDN or reverse proxy, configure the new domain there as well.


Step 3: Install SSL for the New Domain

The new domain should use HTTPS.

Configure an SSL certificate for:

https://newstore.com

and, if required:

https://www.newstore.com

Test the certificate before changing Magento’s URLs.

Make sure:

  • The certificate is valid
  • The certificate chain is complete
  • HTTPS works
  • HTTP can redirect to HTTPS
  • The CDN/proxy SSL configuration is correct

Step 4: Add the New Domain to the Web Server

Configure your Apache or Nginx server to recognize the new domain.

The web server should point the new domain to Magento’s pub directory.

For example:

/var/www/magento/pub

Do not point the public website directly at the entire Magento project root.

After configuring the new virtual host/server block, reload the web server.

For example, depending on your system:

systemctl reload nginx

or:

systemctl reload apache2

Step 5: Check Your Current Magento URLs

Before making changes, check the current Magento Base URLs.

Run:

php bin/magento config:show web/unsecure/base_url

and:

php bin/magento config:show web/secure/base_url

You may see:

https://oldstore.com/

These values need to be changed to the new domain.


Step 6: Update Magento Base URLs

From the Magento root directory, update the base URL:

php bin/magento setup:store-config:set --base-url="https://newstore.com/"

Then configure the secure URL:

php bin/magento setup:store-config:set --base-url-secure="https://newstore.com/"

If your installation uses a separate www version, use the URL you intend to make canonical.

For example:

https://newstore.com/

rather than inconsistently mixing:

https://newstore.com/
https://www.newstore.com/

Choose one canonical version and use redirects for the other.


Step 7: Make Sure HTTPS Is Enabled

Magento should use HTTPS for both the storefront and Admin Panel.

You can configure secure frontend access with:

php bin/magento config:set web/secure/use_in_frontend 1

For the Admin Panel:

php bin/magento config:set web/secure/use_in_adminhtml 1

Then flush the cache:

php bin/magento cache:flush

Step 8: Check for the Old Domain in the Database

Changing the Base URL does not necessarily replace every occurrence of the old domain.

The old domain may appear in:

  • CMS pages
  • CMS blocks
  • Product descriptions
  • Category descriptions
  • Custom HTML
  • Configuration
  • Third-party extension settings
  • Email templates
  • Custom code

Before performing a global replacement, create another database backup.

Do not blindly replace every occurrence of the old domain because some values may need to remain unchanged for redirects, historical records, integrations, or other purposes.

For controlled replacements, identify the specific tables and fields that contain the old domain and update only the appropriate values.


Step 9: Search the Magento Files for the Old Domain

Custom code may contain the old domain.

From the Magento directory, you can search for references with:

grep -R "oldstore.com" app/ --exclude-dir=cache

You can also search custom modules:

grep -R "oldstore.com" app/code/

And custom themes:

grep -R "oldstore.com" app/design/

Review every result before changing it.

Do not automatically replace domain names inside third-party libraries or generated files.


Step 10: Clear Magento Cache

After changing the Base URLs, clear the Magento cache:

php bin/magento cache:flush

Check cache status:

php bin/magento cache:status

If your environment uses additional caching systems such as Redis or Varnish, clear or purge those caches according to your deployment configuration.


Step 11: Clear Generated Data When Necessary

If your Magento deployment requires regenerated static assets, run:

php bin/magento setup:static-content:deploy -f

You may also need:

php bin/magento setup:di:compile

The exact deployment process depends on your Magento version and production workflow.

Do not unnecessarily delete production files without understanding what your deployment process requires.


Step 12: Reindex Magento

Check indexer status:

php bin/magento indexer:status

If necessary, rebuild indexes:

php bin/magento indexer:reindex

Then check again:

php bin/magento indexer:status

Test product search, categories, layered navigation, and other catalog functionality after reindexing.


Step 13: Configure 301 Redirects From the Old Domain

One of the most important parts of a domain migration is redirecting the old domain to the new domain.

For example:

https://oldstore.com/product/example

should redirect to:

https://newstore.com/product/example

Use 301 permanent redirects for permanent domain changes.

Avoid redirecting every old URL to the new homepage when an equivalent page exists.

The ideal structure is:

Old product URL
       ↓
301 Redirect
       ↓
New product URL

This provides a better experience for users and helps search engines understand the migration.


Step 14: Configure Apache Redirects

If the old domain and new domain are handled by Apache, a redirect can be configured in the old domain’s virtual host or appropriate configuration.

A basic example is:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldstore\.com$ [NC]
RewriteRule ^(.*)$ https://newstore.com/$1 [R=301,L]

If you also use the www version, include the appropriate hostname rules.

Test redirects carefully to avoid redirect loops.


Step 15: Configure Nginx Redirects

With Nginx, you can create a dedicated server block for the old domain.

A simplified example:

server {
    listen 80;
    server_name oldstore.com www.oldstore.com;

    return 301 https://newstore.com$request_uri;
}

This preserves the requested path.

For example:

oldstore.com/category/shoes

can redirect to:

newstore.com/category/shoes

The exact configuration should match your existing HTTPS and server architecture.


Step 16: Do Not Redirect the New Domain Back to the Old Domain

After changing Magento’s Base URLs, verify that the new domain does not redirect back to the old one.

For example, this is incorrect:

newstore.com
   ↓
oldstore.com
   ↓
newstore.com

This creates a redirect loop.

Test both domains independently.


Step 17: Check Canonical URLs

Magento and your SEO configuration should use the new domain as the canonical domain.

Check product pages, category pages, CMS pages, and other important URLs.

For example:

<link rel="canonical" href="https://newstore.com/product/example">

The canonical URL should not continue pointing to the old domain after the migration.


Step 18: Update XML Sitemap

After changing the domain, regenerate or update the Magento XML sitemap so that URLs use the new domain.

Your sitemap should contain URLs such as:

https://newstore.com/
https://newstore.com/category/example
https://newstore.com/product/example

It should not continue listing the old domain.

Submit the new sitemap to your search-engine tools after the migration.


Step 19: Update Robots.txt

Check your robots.txt file.

Make sure it does not contain references to the old domain that should now point to the new one.

If you have a sitemap declaration, update it.

For example:

Sitemap: https://newstore.com/sitemap.xml

Be careful not to accidentally block the new site during migration.


Step 20: Update Google Search Console

If you use Google Search Console, add and verify the new domain.

Submit the new sitemap.

For a domain migration, use the appropriate site-move functionality where available and follow Google’s current migration guidance.

Also monitor:

  • Indexing
  • Coverage
  • Redirects
  • Crawl errors
  • Search traffic
  • Sitemap processing

Expect search visibility to fluctuate temporarily while search engines process the domain change.


Step 21: Update Analytics

Update your analytics configuration to recognize the new domain.

Depending on your analytics setup, check:

  • Measurement configuration
  • Referral exclusions
  • Cross-domain settings
  • Conversion tracking
  • Ecommerce tracking
  • Payment gateway referral handling

Test an actual purchase or test transaction where appropriate.


Step 22: Update Third-Party Services

Your Magento store may use services that are tied to the old domain.

Review:

  • Payment gateways
  • Shipping APIs
  • Tax services
  • Email platforms
  • SMTP services
  • CDN
  • WAF
  • CAPTCHA
  • Fraud detection
  • Marketing platforms
  • Webhooks
  • OAuth applications
  • Social login
  • Product feeds

Update the callback URLs, webhook URLs, API settings, or allowed domains where necessary.


Step 23: Update Email Configuration

If your business email is changing along with the domain, configure the new email addresses separately.

For example:

[email protected]
[email protected]

Update Magento’s transactional email configuration and verify:

  • Sender addresses
  • SMTP settings
  • SPF
  • DKIM
  • DMARC

Send test emails for:

  • New account
  • Order confirmation
  • Shipment
  • Password reset
  • Contact form

Step 24: Test Customer Accounts

Customer accounts should continue working after the domain migration.

Test:

  • Customer login
  • Registration
  • Password reset
  • Account dashboard
  • Order history
  • Saved addresses
  • Wishlist
  • Stored preferences

Pay particular attention to login cookies and HTTPS configuration.


Step 25: Test Checkout and Payments

Checkout is one of the most important parts of a Magento domain migration.

Perform a complete test order.

Check:

  • Cart
  • Customer information
  • Billing address
  • Shipping address
  • Shipping method
  • Tax
  • Coupon
  • Payment method
  • Order placement
  • Confirmation page
  • Confirmation email
  • Payment gateway callback

A store should not be considered successfully migrated until checkout has been tested.


Step 26: Check Product Images

Open several product pages and verify that images load correctly.

Also inspect:

pub/media/

If images reference the old domain, identify whether those references are generated by Magento, stored in content, or created by custom code.

Do not blindly modify image URLs without understanding how your Magento media system generates them.


Step 27: Check Internal Links

Search your site for links that still point to the old domain.

Check:

  • Navigation
  • Product descriptions
  • Category descriptions
  • CMS pages
  • CMS blocks
  • Footer links
  • Blog content
  • Custom landing pages

Internal links should generally point directly to the new domain rather than relying on unnecessary redirects.


Step 28: Test the Magento Admin Panel

Access the Admin Panel using the new domain.

For example:

https://newstore.com/your-admin-path/

Verify:

  • Login
  • Dashboard
  • Products
  • Categories
  • Orders
  • Customers
  • Configuration
  • Extensions
  • Reports

If you previously customized the Magento Admin URL, preserve that configuration during the domain migration.


Step 29: Test the Site Before Going Live

Before announcing the new domain, perform a complete test.

Frontend

  • Homepage
  • Categories
  • Products
  • Search
  • Images
  • CMS pages
  • Customer registration
  • Customer login
  • Cart
  • Checkout

Backend

  • Admin login
  • Product management
  • Order management
  • Customer management
  • Configuration
  • Extensions

Technical

  • HTTPS
  • DNS
  • Redirects
  • Canonical URLs
  • Sitemap
  • Robots.txt
  • Cron
  • Cache
  • Indexers
  • Email
  • Payment gateway

Step 30: Monitor the Old Domain

Do not immediately remove the old domain.

Keep it active and redirect it to the new domain.

Monitor:

  • Redirect traffic
  • 404 errors
  • Search-engine crawling
  • Referral traffic
  • Analytics
  • Server logs

This allows visitors and search engines to discover the new domain.


Common Magento Domain Migration Problems

Redirect Loop

If the new domain keeps redirecting between HTTP and HTTPS or between the old and new domains, check:

  • Magento Base URLs
  • SSL configuration
  • CDN settings
  • Web-server redirects
  • Proxy headers

Make sure only one canonical URL is being enforced.


Images Still Use the Old Domain

Check:

  • Magento Base URLs
  • CMS content
  • Product descriptions
  • Theme files
  • Custom modules
  • CDN configuration

Avoid performing uncontrolled database replacements.


Admin Panel Redirects to the Old Domain

Check Magento’s secure Base URL and any custom Admin configuration.

Clear Magento cache afterward:

php bin/magento cache:flush

Checkout Does Not Work

Check:

  • HTTPS
  • Payment gateway configuration
  • JavaScript errors
  • Cookie configuration
  • Third-party callbacks
  • Base URLs
  • CDN/WAF rules

Test the payment gateway separately if required.


Customers Cannot Log In

Check:

  • HTTPS
  • Cookies
  • Session configuration
  • Redis
  • Base URLs
  • CDN caching
  • Browser cache

Clear application caches and test in a private browser window.


Search Rankings Drop

A temporary fluctuation can occur after a domain migration.

Reduce the risk by:

  • Using permanent redirects
  • Preserving URL paths where possible
  • Updating canonical URLs
  • Updating XML sitemaps
  • Verifying the new domain
  • Monitoring crawl errors
  • Updating important external links
  • Maintaining relevant content

Do not intentionally change the domain and URL structure at the same time unless there is a strong reason to do so.


Best Practices for Magento Domain Migration

Keep URL Paths the Same

If possible, preserve:

oldstore.com/product/example

as:

newstore.com/product/example

This makes the migration easier to manage and reduces unnecessary URL changes.

Use 301 Redirects

Permanent redirects should connect old URLs with their corresponding new URLs.

Keep the Old Domain Active

Do not immediately cancel the old domain.

Back Up Before Changes

Create and verify a complete backup before modifying Magento.

Test Before Launch

Use a controlled environment to test the new domain before making it public.

Update External Services

Payment gateways, APIs, email systems, CDNs, and other services may require domain changes.

Monitor After Launch

Continue monitoring errors, traffic, indexing, and checkout after the migration.


Magento New Domain Migration Checklist

Preparation

  • Register/configure new domain
  • Configure DNS
  • Install SSL
  • Configure web server
  • Back up Magento
  • Back up database
  • Record current configuration

Magento Configuration

  • Update Base URL
  • Update Secure Base URL
  • Enable HTTPS
  • Flush cache
  • Reindex
  • Deploy static content if required
  • Verify Admin URL

SEO

  • Configure 301 redirects
  • Update canonical URLs
  • Update XML sitemap
  • Check robots.txt
  • Verify new domain in Search Console
  • Submit new sitemap
  • Monitor crawl errors

Integrations

  • Update payment gateways
  • Update shipping services
  • Update tax services
  • Update SMTP
  • Update CDN/WAF
  • Update webhooks
  • Update API callbacks
  • Update analytics

Testing

  • Test homepage
  • Test products
  • Test categories
  • Test search
  • Test customer login
  • Test password reset
  • Test cart
  • Test checkout
  • Test payments
  • Test emails
  • Test Admin Panel
  • Check redirects
  • Check HTTPS

Final Thoughts

Moving Magento to a new domain requires careful coordination between Magento configuration, DNS, SSL, web-server settings, database content, redirects, SEO, and third-party integrations.

The safest approach is to back up the store first, prepare the new domain and server, update Magento’s Base URLs, preserve existing URL paths where possible, configure permanent redirects, update external services, thoroughly test the store, and monitor the old and new domains after launch.

Most importantly, avoid treating a domain change as a simple DNS update. Magento, search engines, customers, payment providers, and external services all need to recognize the new domain. A well-planned migration can make the transition smooth while minimizing downtime, broken links, and SEO disruption.

ByVandeeta
Updated October 06, 2026
  • Magento

Read Next

ByVandeeta
October 6, 2026

How to Migrate Magento from cPanel to DirectAdmin

How to Migrate Magento from cPanel to DirectAdmin Migrating a Magento store from cPanel to DirectAdmin requires more…
  • Magento
ByVandeeta
October 6, 2026

How to Change Magento Database Credentials

How to Change Magento Database Credentials Magento stores important information such as products, customers, orders, configurations, and CMS…
  • Magento
ByVandeeta
October 6, 2026

How to Recover a Broken Magento Installation

How to Recover a Broken Magento Installation A broken Magento installation can cause a wide range of problems,…
  • Magento

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Explore Categories

  • Control Panels 7
  • Magento 52
  • Miscellaneous 5
  • SEO 17
  • Technology 10
  • Trends 9
  • Web Hosting 7
  • Wordpress 100

Recent Posts

  • How to Fix WordPress “Too Many Redirects”
  • How to Fix WordPress Critical Error
  • How to Fix WordPress Database Connection Error
  • How to Fix WordPress White Screen of Death
  • How to Fix WordPress 404 Error

Recent Comments

  1. Tabias H. on The Future is 5G: Understanding the Next Wave of Connectivity
  2. Elliot Alderson on Evolving Workspaces: The Rise of the Hybrid Work Trend
  3. James Mann on Evolving Workspaces: The Rise of the Hybrid Work Trend
Swyft

Welcome to the Ehostpiya Blog, your trusted resource for web hosting, WordPress, VPS, domains, website security, and online business tips.

Our goal is to make web hosting and website management easier to understand for everyone—from beginners launching their first website to experienced developers and business owners. We publish practical guides, hosting tips, tutorials, and helpful insights to help you build, manage, and grow your website successfully.

At Ehostpiya, we believe that reliable information and quality hosting go hand in hand. Explore our latest articles and discover simple solutions for a faster, safer, and more successful online presence.

  • Facebook
  • Twitter
  • Instagram
  • Pinteres

Featured Posts

  • AI and Ethics: Navigating the Complex Landscape of Artificial Intelligence
    by Vandeeta
    October 11, 2023
  • AR and VR: Blurring the Lines Between Reality and Virtuality
    by Vandeeta
    October 11, 2023
  • Best WordPress Caching Plugins to Improve Website Speed
    by Vandeeta
    September 26, 2026
  • Blockchain Unchained: How Distributed Ledger Technology is Transforming Industries
    by Vandeeta
    October 11, 2023

Web Hosting Discount

cLAIM NOW
logo

Ehostpiya is reliable Web hosting provider, with aim to provide affordable Website and application hosting to various clients for their online business and presence.

Hosting
  • Web Hosting
  • Cloud VPS
  • Reseller Hosting
  • Email Hosting
  • Dedicated Server
  • Nodejs Hosting
  • SSL Certificate
Legal
  • Accepted Uses Policy
  • privacy Policy
  • Terms of Service
  • Refund and cancellation
  • Service Delivery Policy
Company
  • About Us
  • Our Clients
  • Contact Us
  • Our Blog
Support & Tools
  • Open Support Request
  • View Ticket
  • Knowledge Base
  • Report Abuse
  • check nameserver
  • What is my IP
  • Mx lookup

© Ehostpiya, All rights reserved

  • Terms & Condition
  • Privacy Policy