What's the best way to migrate WordPress to new hosting?

imported
4 days ago · 0 followers

Answer

Migrating a WordPress site to new hosting requires careful planning to avoid downtime, data loss, or broken functionality. The most reliable methods involve using specialized plugins like All-in-One WP Migration, Duplicator, or WP Migrate DB Pro, which automate the transfer of files, databases, and configurations. For users with technical expertise, manual migration via FTP and database exports offers greater control but demands precision when editing configuration files and updating DNS settings. Many hosting providers, including WP Engine and WordPress.com, also offer free automated migration tools that simplify the process.

Key findings from the sources reveal:

  • Plugin-based migration is the fastest and most user-friendly approach, with All-in-One WP Migration and Duplicator being the most frequently recommended tools [2][3][7]
  • Manual migration involves backing up files via FTP, exporting the database, creating a new SQL database, and updating the wp-config.php file, which is ideal for advanced users seeking full control [4][8]
  • Zero-downtime migration is achievable by temporarily modifying the local hosts file to test the new site before updating DNS records [7]
  • Hosting providers often include free migration services, particularly for business plans, which can handle the entire process automatically [5][6]

Step-by-Step WordPress Migration Methods

Plugin-Based Migration: Fastest and Most Reliable

Using a dedicated migration plugin is the most efficient method for most users, as it automates complex steps like database serialization and URL updates. The All-in-One WP Migration plugin is the most widely recommended due to its simplicity and compatibility with large sites, while Duplicator offers advanced features like pre-configured installers for seamless deployment.

The process typically follows these steps:

  • Install the plugin on both the original and new WordPress installations. All-in-One WP Migration is available for free in the WordPress repository, while Duplicator offers a free version with paid upgrades for larger sites [2][3]
  • Export the site from the original host. The plugin bundles all files, themes, plugins, and the database into a single archive. All-in-One WP Migration allows direct downloads or cloud storage uploads (Google Drive, Dropbox), while Duplicator generates a .zip file and an installer script [3][7]
  • Import to the new host by uploading the archive via the plugin’s interface. For large sites (>512MB), All-in-One WP Migration requires the "Unlimited Extension" add-on, while Duplicator handles larger files natively in its Pro version [3][8]
  • Update permalinks and test functionality. After import, navigate to Settings > Permalinks and click "Save Changes" to refresh rewrite rules. Verify all pages, media, and plugins work correctly before switching DNS [2][4]

Advantages of plugin-based migration:

  • No technical knowledge required—ideal for beginners [3]
  • Handles URL replacements automatically, reducing errors [2]
  • Supports multistep migrations with progress tracking [7]
  • Some plugins (like WP Migrate DB Pro) offer selective data migration (e.g., excluding spam comments) [1]

Limitations to consider:

  • Free versions may impose file size limits (e.g., All-in-One WP Migration caps at 512MB without add-ons) [3]
  • Complex sites with custom databases may require manual adjustments post-migration [4]
  • Plugin conflicts can occur if the new host has restrictive file permissions [8]

Manual Migration: Full Control for Advanced Users

For users comfortable with FTP, SQL, and server configurations, manual migration provides granular control over every aspect of the transfer. This method is particularly useful for large or custom-built sites where plugins may fail to capture all dependencies. The process involves six critical steps:

  1. Backup all files and the database - Use an FTP client (FileZilla, Cyberduck) to download the entire public_html or WordPress root directory from the old host [8] - Export the database via phpMyAdmin or the command line using mysqldump. Example command:
mysqldump -u [username] -p[password] [database_name] > wordpress_db.sql
[4][8]
  1. Set up the new hosting environment - Create a new MySQL database on the new host and note the database name, username, and password [7] - Install a fresh WordPress instance on the new host (most hosts offer one-click installs via Softaculous or cPanel) [1]
  1. Upload files and import the database - Transfer all WordPress files to the new host via FTP or SSH [8] - Import the SQL file into the new database using phpMyAdmin or the command:
mysql -u [username] -p[password] [newdatabasename] < wordpress_db.sql
[4]
  1. Update the wp-config.php file - Edit the file to reflect the new database credentials:
define('DBNAME', 'newdatabasename');

define('DBUSER', 'newusername'); define('DBPASSWORD', 'newpassword'); define('DBHOST', 'localhost');

[4][8]

  1. Test the site before DNS changes - Temporarily modify your local hosts file to point the domain to the new host’s IP, allowing you to test without affecting live traffic. On Windows, add this line to C:\Windows\System32\drivers\etc\hosts:
[newhostIP] yourdomain.com

On macOS/Linux, edit /etc/hosts similarly [7]

  1. Update DNS records - Change the domain’s A record or nameservers to point to the new host. Propagation typically takes 24–48 hours [6][7]

When to choose manual migration:

  • The site uses custom database tables or non-standard WordPress configurations [4]
  • The hosting environment has strict security policies blocking plugins [8]
  • You need to exclude specific files or data during the transfer [1]

Risks of manual migration:

  • Human error in SQL imports or file transfers can corrupt the site [4]
  • Incorrect wp-config.php settings will break the site entirely [8]
  • Downtime is likely if DNS is updated before thorough testing [7]

Hosting Provider Migration Services: Hands-Off Solution

Many hosting companies, particularly managed WordPress hosts like WP Engine, WordPress.com, and Liquid Web, offer free or low-cost migration services. These services are ideal for users who prefer a hands-off approach or lack technical expertise. The process typically involves:

  • Submitting a migration request through the new host’s dashboard or support ticket system. WordPress.com, for example, provides a migration key that automates the transfer of content, plugins, and themes [5]
  • Providing access credentials for the old host (FTP, phpMyAdmin, or cPanel details). Some hosts, like Jetpack, require SSH/SFTP access for secure transfers [6]
  • Reviewing the migrated site in a staging environment before going live. WP Engine and Liquid Web include staging sites as part of their migration process [4][8]
  • Finalizing the switch by updating DNS records, which the host may assist with [5]

Benefits of provider-assisted migration:

  • No technical work required—ideal for non-developers [5]
  • Often includes post-migration support for troubleshooting [6]
  • Minimal downtime due to professional handling [4]

Drawbacks to consider:

  • Limited to hosts that offer migration services (not all budget hosts include this) [1]
  • May take 24–72 hours to complete, depending on the host [5]
  • Some hosts only migrate content, excluding emails or subdomains [4]
Last updated 4 days ago

Discussions

Sign in to join the discussion and share your thoughts

Sign In

FAQ-specific discussions coming soon...