Managed technical services across Canada
Proudly Canadian

Guide

How to Migrate WordPress to Canadian Hosting: A Step-by-Step Guide

Moving your WordPress site to Canadian hosting is one of the most impactful infrastructure decisions a Canadian business can make. This guide covers the complete migration process with specific steps for WordPress, from backup to DNS switch.

Editorial process: This article was created with AI assistance and prepared for publication by Gotekky.

Quick answer

What to check first

Moving your WordPress site to Canadian hosting is one of the most impactful infrastructure decisions a Canadian business can make. This guide covers the complete migration process with specific steps for WordPress, from backup to DNS switch.

Migrating WordPress to a new host is a common task, but the specifics matter. A poorly executed migration causes downtime, broken functionality, or data loss. This guide covers the complete process for moving a WordPress site to Canadian hosting correctly and with minimal downtime.

What you need before starting

Access to your current hosting control panel or server via SSH or SFTP. A destination Canadian hosting account with the correct PHP version, MySQL/MariaDB, and sufficient storage. Your domain registrar login for the DNS update. The ability to edit your local hosts file for testing, which requires administrator access on your computer. For WordPress specifically, either WP-CLI access on both servers or access to phpMyAdmin for database export and import.

Step 1: Audit the current WordPress installation

Before migrating, understand what you are moving. Log into your WordPress admin and note the PHP version under Tools, Site Health. Check what plugins are active. Confirm the WordPress version. Look at the database size in phpMyAdmin or through wp-cli with `wp db size`. Check whether the site uses any file-based caching that stores files outside the normal WordPress directory structure. Look for any custom cron jobs or scheduled tasks in cPanel or Webuzo that need to be recreated on the new server. Also check whether you have email hosting on the same account that will need migrating or reconfiguring.

Step 2: Create and download a complete backup

Do not rely on your current host's backup system. Create a fresh backup yourself and download it to your local machine. For WordPress files, download everything via SFTP. This includes wp-content with all themes, plugins, and uploads, as well as wp-config.php and any custom .htaccess modifications. For the database, use WP-CLI to create an export:

wp db export --add-drop-table backup.sql

Or use phpMyAdmin to export all tables. Verify the SQL file size looks reasonable for your site's content volume. An export of zero bytes or a few kilobytes when you expected hundreds of megabytes has failed.

Step 3: Set up the destination Canadian server

Create a hosting account on the new Canadian server. Install the same PHP version your current site uses, or upgrade to 8.2/8.3 if your plugins support it (check your most critical plugins' compatibility first). Create a MySQL database, database user, and assign the user to the database with full privileges. Note the database name, username, and password for the next step.

Upload your WordPress files via SFTP to the new account's public_html or web root directory. Import the database via WP-CLI or phpMyAdmin. Then edit wp-config.php on the new server to update the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST constants to match the new database credentials.

Step 4: URL update and search-replace in the database

If your site URL is the same on the new server (which it will be after DNS propagates), no URL search-replace is needed for the final site. However, you may need to run a search-replace to fix any hardcoded references to the old server's IP or to an http:// URL if the new server uses https://. Use WP-CLI for this:

wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' --all-tables

WP-CLI handles serialized data correctly, which a plain SQL replace does not. This is important for WooCommerce sites where cart and order data is stored serialized.

Step 5: Test thoroughly using the hosts file

Edit your local hosts file to point your domain at the new server's IP. This lets you browse the site as if it were live while DNS still points at the old host. Test every critical path: home page, blog posts, product pages, cart, checkout, contact form, login and logout. Test on mobile by temporarily using a VPN or by sharing your hosts file modification to a test device. Check for mixed content warnings in the browser (a padlock with an exclamation mark), which indicate that some resources are still being loaded over HTTP. Fix any mixed content by running another search-replace for http:// image URLs.

Step 6: Lower the DNS TTL, then switch

Twenty-four hours before you are ready to go live, lower your DNS A record TTL to 300 seconds. When ready, update the A record to point at the new Canadian server IP. At 300-second TTL, propagation takes five to ten minutes for most users globally. Monitor both servers during the propagation window. Keep the old hosting account active for one week as a rollback option.

Gotekky

Need help deciding what to do next?

Tell us what you are seeing and what outcome you need. We will identify whether a managed service, scoped project or paid technical assessment is the right next step.