Switching Website Hosting Services

Changing your Hosting: A Technical Guide for SEO

This guide provides a detailed walkthrough for minimizing SEO impact when changing your website's hosting infrastructure. This includes switching hosting providers or migrating to a content delivery network (CDN).

Important: This guide only applies to migrations that don't change user-visible URLs. If you're planning URL changes, refer to the guide on Site moves with URL changes.

1. Preparing the New Hosting Infrastructure

Before initiating the move, meticulously prepare your new hosting environment:

1.1. Copy and Test Your Website

1.1.1. Replication:

Begin by creating a complete replica of your website on the new hosting platform. This might involve:

  • Direct File Transfer: Directly copying your website's files and directories to the new server (common with static HTML sites).

    # Example using scp (secure copy)
    scp -r /path/to/your/website user@new-host:/path/to/new/location
  • Database Export and Import: Exporting your website's database from the old host and importing it into a new database on the new host (common with CMS-based websites like WordPress).

    # Example MySQL command to export a database named 'your_database'
    mysqldump -u your_username -p your_database > your_database.sql
    
    # Example MySQL command to import the database on the new host
    mysql -u your_username -p new_database < your_database.sql

1.1.2. Comprehensive Testing:

Once replicated, rigorously test every aspect of your website on the new host:

  • Controlled Testing Environment: Establish an environment with IP-restricted access for thorough testing before public launch. This can be achieved by configuring your web server to only allow specific IP addresses.

    # Example Apache configuration to restrict access to a specific IP
    <Location />
        Order Deny,Allow
        Deny from all
        Allow from 192.168.1.10
    </Location>
  • Browser Compatibility: Open your website in various browsers (Chrome, Firefox, Safari, Edge) and devices (desktop, mobile, tablet) to ensure consistent layout and functionality.

  • Functional Testing: Test all interactive elements:

    • Forms: Submit forms to verify data processing and confirmation messages.

    • Downloads: Download files (PDFs, images, etc.) to ensure accessibility and integrity.

    • Internal Links: Click through all internal links to confirm they point to the correct locations on the new host.

1.1.3 Public Testing (Optional):

Consider using a temporary hostname for your new infrastructure (e.g., beta.yourwebsite.com) for public testing. This aids in:

  • Accessibility Testing: Allowing users to access and provide feedback on the new site before the official switch.

  • Search Engine Accessibility: Testing if search engine bots can access and crawl the site on the new host.

Important: To prevent premature indexing of the test site, add the noindex robots meta tag to your site's HTML or HTTP headers:

HTML:

<meta name="robots" content="noindex">

HTTP Header:

X-Robots-Tag: noindex

1.2. Googlebot Access Verification:

  • Google Search Console: If you don't have one already, create a Google Search Console account for your site. If using a temporary hostname, verify that property as well.

  • URL Inspection Tool: Use Search Console's URL Inspection Tool to ensure Googlebot can access your new infrastructure.

  • Firewall and DoS Configuration: Double-check your firewall and DoS protection settings. Ensure they don't accidentally block Googlebot from accessing your DNS or hosting servers.

1.3. Lower DNS TTL Value

  • What is TTL? TTL (Time to Live) dictates how long ISPs cache your DNS records.

  • Why Lower It? Lowering the TTL before the move allows the new DNS settings to propagate faster, resulting in a quicker switch for users.

  • Recommended Action: Lower the TTL to a few hours at least a week before the move.

1.4. Search Console Verification

  • Verification Continuity: Ensure your Search Console verification remains intact after the migration.

  • HTML File Method: If using the HTML file method, include your verification file in the root directory of your new site.

  • Meta Tag or Google Analytics: If using a meta tag or Google Analytics for verification, ensure these are correctly implemented in your new site's code or CMS templates.

2. Starting the Move

With preparations complete, initiate the move:

2.1. Remove Crawl Blocks:

  • Disable robots.txt Restrictions: Ensure your robots.txt file on the new host doesn't block search engines.

  • Remove noindex Directives: Delete any noindex meta tags or HTTP headers used during the testing phase.

2.2. Update DNS Settings:

  • Contact DNS Provider: Coordinate with your DNS provider to update your domain's DNS records to point to the new hosting provider's servers.

3. Monitoring Traffic

Continuously monitor the transition:

  • Server Logs: Analyze server logs on both old and new servers to track traffic migration.

  • DNS Propagation Check: Utilize public DNS checking tools to monitor how quickly your new DNS settings propagate globally.

  • Google Search Console: Monitor the "Index Coverage" reports to track how Google indexes your site on the new infrastructure.

Note on Crawl Rate: Expect a temporary dip in Googlebot's crawl rate immediately after the move. This is normal as Google readjusts to your new infrastructure. The crawl rate should stabilize and potentially increase within a few days.

4. Shutting Down Old Hosting

  • Zero Traffic Confirmation: Once your server logs indicate zero traffic to the old hosting, it's safe to shut down the old infrastructure.

  • Final Check: Before shutting down completely, do a final sweep to ensure no critical data or configurations are left behind.

By following these steps meticulously, you can minimize downtime and maintain your website's search engine visibility during a hosting migration.

Last updated