Migrating a WordPress site can be tricky, but getting your hosting environment right is the key to a smooth transition. This guide walks you through the essentials:
- Document Your Current Setup: Note PHP versions, database engines, and server specs.
- Upgrade Outdated Software: Use PHP 8.3+ and MySQL 8.4 or MariaDB 10.6+ for better security and performance.
- Choose the Right Hosting: Compare shared, VPS, and dedicated hosting based on your site’s needs.
- Prepare Your New Server: Set up databases, enable SFTP, and ensure compatibility with WordPress requirements.
- Test Before Going Live: Use a staging environment to troubleshoot issues and optimize performance.
Following a pre-migration planning checklist and testing ensure minimal downtime and fewer errors during migration. Let’s dive into the details!
Step 1: Review Your Current Hosting Environment

WordPress Server Requirements: Minimum vs Recommended Specifications
Before diving into migration, take a moment to document your current hosting setup. This step helps you avoid errors and ensures your new environment is compatible. A detailed review now can save you from major headaches later. Start by evaluating your server’s performance and identifying any compatibility concerns that could become stumbling blocks during migration.
Check Server Resources and Performance
To get a snapshot of your server’s resources, log into your WordPress dashboard and navigate to Tools » Site Health » Info. This section provides key details like your PHP version, memory limits, and server architecture [2].
First, check your PHP version. WordPress 6.8 supports PHP 8.1 and 8.2, with beta compatibility for PHP 8.3 and 8.4 [3]. If you’re still on PHP 8.1, it’s time to upgrade – this version reaches End of Life on December 31, 2025 [3]. Similarly, PHP 8.2 support ends on December 31, 2026 [3]. Using outdated PHP versions can leave your site vulnerable to security threats and performance issues.
Your database version is equally important. WordPress recommends MySQL 8.0/8.4 LTS or MariaDB 10.6/10.11/11.4/11.8 LTS [3]. Note that MySQL 8.0 LTS will reach End of Life in April 2026 [3]. If you’re using it, plan for an upgrade during migration to avoid future problems.
Here’s a quick reference for server requirements:
| Specification | Minimum Requirement | Recommended for Performance |
|---|---|---|
| PHP Version | 7.4 (Legacy) / 8.1+ | 8.2 or 8.3 [4][3] |
| MySQL Version | 5.5.5 (Legacy) / 8.0+ | 8.4 LTS [4][3] |
| MariaDB Version | 10.4+ | 10.11 or 11.4 LTS [2][3] |
| RAM | 512 MB | 1 GB+ with expansion options [2] |
| Disk Space | 1 GB | 10 GB+ (SSD preferred) [2] |
| CPU | 1.0 GHz | Multi-core processors [2] |
Next, review your storage type. If your host uses HDDs (hard drives) instead of SSDs (solid-state drives), your database performance is likely lagging [2]. SSDs are much faster since they don’t rely on mechanical parts. To check your disk space, use SSH commands: du -sh wp-content measures the size of your uploads folder, and df -h shows overall space remaining on your server [1].
For real-time performance insights, SSH tools like top or htop can monitor CPU and RAM usage as your site operates [7]. If you notice high "I/O wait" times, it’s a sign your storage is slowing down requests, indicating a need for faster hardware [7]. Frequent "memory exhausted" errors suggest your PHP memory limit is too low – often set at just 64 MB by default [2].
Once you’ve assessed your server’s resources, shift focus to software compatibility to ensure a smooth transition.
Find Compatibility Problems
Software compatibility issues can quietly derail a migration. Start by examining your PHP extensions. WordPress requires json and mysqli to function properly [3]. Without these, your site won’t even load. Other helpful extensions include curl (for remote requests), imagick (for image processing), mbstring (for UTF-8 text), and zip (for plugin updates) [3].
To get a full report on your server’s extensions and settings, create a temporary file containing <?php phpinfo(); ?>. Open it in your browser to view the details, then delete the file immediately to protect your site [8].
Check your web server software as well. The recommended options are Apache 2.4 and Nginx 1.26/1.27 [3]. Nginx currently powers over 34% of web servers, while Apache supports about 31% [2]. If your host uses an outdated or unsupported version, you’ll need to address that before migration.
If you’re still running outdated software like PHP 7.4 or MySQL 5.5, you’re exposing your site to security risks [4]. Many modern plugins and themes require newer PHP versions than the WordPress core minimum, so sticking with old software could lead to site crashes [2][10].
Lastly, inspect your autoloaded options in the wp_options table. If these exceed 800 KB, they can significantly slow down your site [5]. Use a tool like Query Monitor to identify database queries that take longer than 5–10 seconds to execute [7]. Resolving these bottlenecks now will help you avoid carrying over performance issues to your new host.
Once you’ve confirmed compatibility, you’ll be ready to configure your new hosting environment with confidence.
sbb-itb-77ae9a4
Step 2: Select the Right Hosting Provider
Picking the right hosting provider isn’t just a technical decision – it directly impacts your site’s performance, security, and ability to scale. A poor choice could lead to slow loading times, frequent downtime, and inadequate support. Once you’ve reviewed your site’s current environment, it’s time to find a host that aligns with your needs.
What to Look for in a Hosting Provider
After evaluating your site’s technical needs in Step 1, focus on key features like performance, security, and support when comparing hosting providers.
Performance is non-negotiable. Look for hosts that use SSD storage, LiteSpeed caching, and CDN integration. Why? SSDs improve database query speeds, LiteSpeed can double page load speeds compared to standard hosting, and CDNs like Cloudflare Enterprise reduce latency for visitors across different regions [11][12].
Security should also be a priority. Ensure your host offers free SSL certificates, dedicated firewalls, DDoS protection, and automated security scans [12]. These features are especially critical for eCommerce sites or any platform handling sensitive user data.
If you’re running WordPress, WordPress-specific optimizations are a big plus. Features like one-click staging environments, pre-installed WordPress setups, and automatic updates for the core platform and plugins can save you time and headaches [11]. Many premium hosts also include free managed migration services, with experts handling the technical details to ensure a seamless transition and minimal downtime [12].
Reliability is another key factor. Look for hosts with a 99.99% uptime guarantee and 24/7 expert support. This ensures your site stays online and that help is available whenever you need it – even in the middle of the night.
Finally, verify that your host supports the necessary technical requirements, such as PHP versions 8.2 or 8.3, and essential extensions like mysqli, json, curl, and imagick. For databases, ensure compatibility with MySQL 8.4 LTS or MariaDB 10.11/11.4 LTS [3].
Shared vs. VPS vs. Dedicated Hosting
The type of hosting you choose impacts your site’s performance, security, and scalability. Here’s a breakdown of the main options:
- Shared Hosting: This is the most affordable option, with prices ranging from $2 to $15 per month. However, since multiple websites share the same server resources, performance can be inconsistent. A traffic spike on another site could slow yours down. Shared hosting is best for small blogs or portfolios but may not be suitable for eCommerce or high-traffic sites [13][14].
- VPS Hosting: A Virtual Private Server (VPS) gives you a dedicated slice of server resources, ensuring more stable performance and better isolation than shared hosting. Plans typically cost between $20 and $80 per month. If your site frequently hits resource limits or experiences errors, VPS hosting is a solid upgrade [13][14].
- Dedicated Hosting: With dedicated hosting, your site gets an entire physical server to itself. This setup offers the highest performance and security but comes at a premium, with costs ranging from $100 to $700+ per month. It’s ideal for large enterprises, high-traffic sites, or platforms requiring strict compliance standards. However, it often requires advanced technical expertise unless you opt for a managed plan [13][14].
| Hosting Type | Best For | Monthly Cost | Performance | Security Level |
|---|---|---|---|---|
| Shared | Small blogs, portfolios | $2–$15 | Variable; can be affected by others | Basic; shared environment risk |
| VPS | Growing businesses, mid-traffic sites | $20–$80 | Stable; guaranteed resources | Strong; virtual isolation |
| Dedicated | Large enterprises, high-traffic stores | $100–$700+ | Maximum; full server power | Highest; physical isolation |
Page load speed is directly tied to user engagement and conversions. For example, if your page load time increases from 1 to 3 seconds, your bounce rate could rise by 32% [14]. Choose a hosting plan that not only meets your current traffic demands but also allows room for growth. Switching plans later may require another migration, so it’s worth planning ahead.
Step 3: Configure the Destination Hosting Environment
After choosing your hosting provider, it’s time to prepare the server for your WordPress site. This includes checking technical requirements, setting up the database, and enabling secure file transfer access. Ensuring everything is set up correctly will make the migration process smooth.
Meet Server Requirements
Your new server must meet WordPress’s minimum technical requirements. For the best performance and security, WordPress recommends PHP version 8.3 or higher. While older versions like PHP 7.4+ might still work, anything below PHP 8.0 is no longer supported and could expose your site to security vulnerabilities. For reference, PHP 8.3 will be supported until December 31, 2027, while PHP 8.2 support ends a year earlier, on December 31, 2026 [3][4].
For database compatibility, use MySQL 8.0 or greater or MariaDB 10.6 or greater [4]. Additionally, your server should run Apache 2.4 or Nginx 1.26/1.27 for dependable performance [3]. To put this in perspective, Apache powers roughly 31% of web servers, while Nginx accounts for over 34% [2].
Make sure essential PHP extensions like mysqli (for database interaction), json (for data processing), curl, and imagick are enabled to ensure compatibility with plugins and themes [3]. You can use WordPress’s Site Health tool (found under Tools > Site Health) to check your current PHP and database versions.
If your site uses resource-heavy plugins like WooCommerce, consider requesting a PHP memory limit of at least 256 MB from your hosting provider. While a basic WordPress site can run on 64 MB, 256 MB is recommended for more complex setups [9].
Here’s a quick reference for server requirements:
| Requirement | Minimum Specification | Optimal Recommendation |
|---|---|---|
| PHP | 7.4+ | 8.3+ |
| MySQL | 5.7+ | 8.0+ |
| MariaDB | 10.3+ | 10.6+ or 11.4+ LTS |
| RAM | 512 MB | 2 GB or more |
| Disk Space | 1 GB | 5 GB+ (SSD/NVMe) |
| Web Server | Any with PHP/MySQL support | Nginx or Apache with mod_rewrite |
Create a Database and User Account
Once your server meets the requirements, the next step is setting up a database for your WordPress site. Every WordPress installation needs its own dedicated database and user account. You can create these using your hosting control panel’s database wizard.
- Database Name and User: Many shared hosting providers add a prefix to the database name based on your account username (e.g.,
accountname_dbname) [15]. Write down the database name, username, and password in a secure file – you’ll need these details for thewp-config.phpfile later [15]. - Database Hostname: Most hosts use "localhost" as the database hostname, but some may require a specific IP address or hostname. Double-check with your provider [15].
- Collation Setting: If you’re using phpMyAdmin, set the collation to
utf8mb4_general_cifor better language and encoding compatibility [15].
Make sure to grant all privileges to the user account you create. Missing permissions can lead to errors or issues with plugin installations.
Set Up FTP/SFTP Access
The final step before migration is configuring secure file transfer access. This allows you to upload WordPress files to your new server. It’s best to use SFTP (Secure File Transfer Protocol), as it encrypts both your data and passwords, unlike standard FTP [16].
"SFTP (Secure File Transfer Protocol) … transfers your files and your password over a secured connection, and should therefore be used instead of FTP whenever possible."
– WordPress Developer Resources [16]
To enable SFTP, go to your hosting control panel and create an SFTP/SSH user. Some hosts may require you to manually activate SFTP or SSH access before generating credentials [16]. You’ll need the following details:
- Host address (URL or IP)
- Username
- Password
- Port number (usually 22 for SFTP) [17]
For managing file transfers, use an FTP/SFTP client like FileZilla, Cyberduck, or WinSCP. These tools are great for handling large uploads, resuming interrupted transfers, and organizing transfer queues [16]. Save your credentials in the client’s "Site Manager" for easy access and proper configuration [17].
When connecting for the first time, you may be prompted to accept a server host key or fingerprint. Always verify this information with your host to ensure you’re connecting to the correct server [18]. WordPress files are typically stored in directories like public_html, www, htdocs, or web [20].
Step 4: Install WordPress on the New Server
Now that your hosting environment is set up, it’s time to install WordPress. You have three main options: using an auto-installer in your control panel, uploading files manually via FTP, or letting a managed hosting provider handle it automatically. Each method gets the job done – choose the one that matches your comfort level and hosting setup.
Install WordPress
Most hosting providers offer tools like Softaculous in cPanel, which makes installation quick and easy. To use this method, log in to your control panel, find the WordPress icon under the Auto Installers section, and click "Install." Select your protocol – use https:// if SSL is already activated – and choose your domain. Set up your site title, description, and admin credentials. Avoid using "admin" as your username for security reasons. Once you click "Install", the process usually takes less than two minutes.
For a manual installation, download the latest WordPress package from WordPress.org and unzip it. Use an FTP client to upload the unzipped files to your server’s root directory (/public_html/). Rename the wp-config-sample.php file to wp-config.php and open it in a text editor. Update the database name, username, password, and host with the credentials you set up earlier. Typically, the host is "localhost", but some providers might require a specific IP address or port number. Double-check for any extra spaces in these credentials to avoid connection errors. Save the file, upload it if necessary, and visit your domain in a browser to complete the "Famous 5-Minute Install."
If you encounter a "memory size exhausted" error during this process, add the following line to wp-config.php to increase the memory limit:
define('WP_MEMORY_LIMIT', '256M');
Once WordPress is installed, you can move on to refining the configuration for better security and performance.
Configure wp-config.php and Enable SSL
After installation, make some updates to wp-config.php to optimize security and ensure your site aligns with the hosting setup. These adjustments help avoid common migration issues and strengthen your site.
Start by updating all security keys (e.g., AUTH_KEY, SECURE_AUTH_SALT) to invalidate existing cookies and improve security. Generate fresh keys using the WordPress.org secret-key service.
To enforce a secure connection, add this line above the "That’s all, stop editing!" comment in wp-config.php:
define('FORCE_SSL_ADMIN', true);
Next, hard-code your site URLs by adding:
define('WP_HOME', 'https://example.com'); define('WP_SITEURL', 'https://example.com');
Replace example.com with your actual domain. This ensures your site URL settings remain consistent and prevents issues caused by incorrect database entries.
"Defining these constants [WP_SITEURL and WP_HOME] hard-codes your site’s URL configuration, which improves portability and helps prevent issues caused by typos or misconfiguration in the dashboard." – WordPress Developer Resources
If you’re using Apache, add this redirect rule to the top of your .htaccess file to redirect all HTTP traffic to HTTPS:
RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
For Nginx users, include this line in your configuration file:
return 301 https://$host$request_uri;
These steps ensure visitors always access the secure version of your site, which is particularly important since Google considers HTTPS a ranking factor.
To enhance security further, disable the built-in plugin and theme editor by adding this line to wp-config.php:
define('DISALLOW_FILE_EDIT', true);
After migration, clear old cached data by deleting transients from the database. Use this query:
DELETE FROM wp_options WHERE option_name LIKE '%_transient_%';
Finally, remember that DNS changes after migration can take anywhere from 4 to 48 hours to fully propagate [6], so temporary visibility issues might occur during this period.
Step 5: Test the Hosting Environment
This phase is all about making sure everything works perfectly before your site goes live. Testing the hosting environment ensures that the changes you’ve made during setup are functioning as they should. Skipping this step could lead to broken features, slow performance, or even security issues after migration.
Verify Server Configuration
Start by confirming that your server meets all the technical requirements for WordPress. This means checking the PHP version, database version, and active extensions:
- One way to do this is by uploading a temporary
phpinfofile (e.g.,sffdsajk234.php) containing the code<?php phpinfo(); ?>. Open it in your browser to review the PHP version and extensions. Be sure to delete this file immediately afterward to protect sensitive server details [8]. - Alternatively, you can check these details via SSH commands like
php -v,mysql -V, andnginx -vorapache2 -v[1].
Your server needs to run PHP 8.3 or higher, supported until December 31, 2027, and use MySQL 8.0 or MariaDB 10.6 or newer [3][4]. To future-proof your setup, consider upgrading to MySQL 8.4 (supported until April 2032) or MariaDB 10.11 (supported until February 16, 2028) [3].
Make sure required extensions like mysqli and json are active, along with recommended ones such as curl, dom, imagick, mbstring, and zip [3]. You can find this information in the phpinfo output or by using the Health Check & Troubleshooting plugin, which helps identify configuration issues [25].
Testing your database connection is also essential. Try logging into phpMyAdmin or use the credentials from your wp-config.php file. If you hit connection errors, verify the database host details – most use "localhost", but some may require a specific IP or port. Also, confirm that directory permissions are set to 755 and file permissions to 644 [1].
Once these checks are complete, move on to testing in a staging environment.
Use a Staging Environment
After ensuring your server meets WordPress requirements, validate the setup in a staging environment. This is essentially a replica of your live site, allowing you to test without affecting your actual website. It’s the perfect place to catch issues like broken forms, missing images, or plugin conflicts before they impact visitors.
"A WordPress staging environment reduces deployment risk by providing a controlled place to validate code and content." – Jack Williams, WordPress and Server Management Specialist [21]
Set up the staging site on a subdomain like staging.example.com or in a separate directory. Secure it with HTTP Basic Authentication and a noindex directive to keep it hidden from search engines [24][21][23]. Ensure the staging environment mirrors your production server’s specs, including PHP version, memory limits, and software, for accurate testing [1][21].
Enable debugging by setting WP_DEBUG to true in your wp-config.php file. This will reveal any hidden PHP errors or plugin conflicts [24].
Now, systematically test your site:
- Check all forms (e.g., contact forms, newsletter sign-ups) to ensure they work as expected.
- For e-commerce sites, simulate a full transaction – add items to the cart, complete checkout, and confirm order emails arrive correctly [22].
- Click through navigation menus, footer links, and internal content to catch 404 errors or outdated links pointing to your old domain.
- Test user login and logout flows for different roles (Admin, Editor, Author) to confirm permissions are set correctly [22].
- Use the "Forgot Password" feature to ensure the server can send system emails.
Check for encoding issues by scanning posts and pages for odd characters like ’ instead of apostrophes. Look for broken shortcodes or missing images in the Media Library [22]. If you’re changing domains, use a tool like "Better Search Replace" to update URLs in the database [22][19].
Finally, run performance tests with tools like Lighthouse, GTmetrix, or WebPageTest. Measure metrics like Time to First Byte (TTFB) and Core Web Vitals to compare against your current site. This helps identify any performance drops before going live. To prepare for the final migration, lower your DNS Time-To-Live (TTL) to 60–300 seconds at least 48–72 hours in advance. This allows for faster testing and quicker DNS propagation [1].
Conclusion
Migrating a WordPress site requires careful planning – it involves DNS settings, databases, files, SSL certificates, and active user sessions, all of which can be tricky to handle without causing disruptions [1]. A well-thought-out strategy minimizes downtime and avoids costly mistakes.
Start by documenting your current setup. Note details like the PHP version, database engine, and disk usage to ensure everything aligns with your new hosting environment [1]. Opt for a hosting provider that supports modern standards, such as PHP 8.3 or higher and MySQL 8.0+ or MariaDB 10.6+, and offers SSD storage for faster performance [4]. Before going live, test everything in a staging environment to identify plugin conflicts or deprecated functions that could cause issues [1].
As Jack Williams, a WordPress and Server Management Specialist, puts it:
"The combination of preparation, testing, and observability is what separates successful migrations from costly surprises." [1]
Make use of tools like WP-CLI for search-and-replace tasks, and lower your DNS TTL to 60–300 seconds at least 48–72 hours before the migration to speed up DNS propagation [1]. After the migration, double-check SSL configurations, set file permissions (755 for directories and 644 for files), and review Core Web Vitals to confirm the performance improvements you aimed for [1].
FAQs
How do I choose between shared, VPS, or dedicated hosting for my site?
When deciding on hosting, it’s all about matching your website’s size, traffic, and future growth with the right option:
- Shared Hosting: A budget-friendly choice for smaller sites with low traffic. However, resources and performance are limited since you’re sharing with other users.
- VPS Hosting: A step up, offering more control and improved performance, making it a great fit for growing websites.
- Dedicated Hosting: Designed for large, high-traffic sites, this option provides exclusive access to resources and top-notch security.
As your site grows, consider upgrading to ensure it runs smoothly and efficiently.
How can I preview my migrated site before DNS changes?
To check out your migrated site before updating your DNS settings, you can use a temporary URL or a staging environment. One way to do this is by setting up a staging A record. This involves pointing a subdomain (like stage.yourdomain.com or dev.yourdomain.com) to your hosting server’s IP address. This method allows you to preview and test your site without impacting your live domain.
Another option is to take advantage of private staging environments, which many hosting providers offer. These environments let you thoroughly test your site before making it live by updating your DNS.
What causes database connection errors after migration?
Database connection errors following a migration usually stem from a few common culprits: incorrect database credentials in the wp-config.php file, corrupted databases, or damaged WordPress files. These problems often result from misconfigurations, issues during file transfers, or server-related glitches. To fix these errors, carefully review your settings and verify that all files and databases were transferred properly.

