How to Migrate a WordPress Site to New Hosting
Moving your WordPress website to a new hosting provider does not have to be complicated. With the right preparation, a complete backup, and a careful transfer process, you can move your files and database while minimizing downtime and avoiding common errors.
Why Migrate Your WordPress Site to New Hosting?
Website owners move WordPress to new hosting for many reasons. Their current hosting may be too slow, expensive, unreliable, or limited for a growing website. A new hosting provider may offer better performance, more storage, improved support, or the server configuration needed for a business website.
A hosting migration means transferring the website from one server to another while keeping its content and functionality. In a typical migration, you need to move the WordPress core files, themes, plugins, uploaded media, and database.
Changing hosting does not automatically mean changing your domain name. If your domain stays the same, you generally update its DNS settings after the new copy of the website has been tested. If you are also changing domains, additional URL updates and SEO checks will be necessary.
What to Prepare Before Migrating WordPress
A successful WordPress hosting migration begins with preparation. Before changing anything, make sure you can access both hosting accounts and have a reliable backup of your existing website.
- Access to the old hosting control panel or FTP/SFTP.
- Access to the new hosting control panel.
- A backup of all WordPress files and the database.
- The current database name, username, and other connection details, if needed.
- The domain registrar or DNS management account.
- Information about your PHP version and important server requirements.
- Enough storage space on the destination server.
Check whether the new hosting supports your WordPress version, PHP requirements, database engine, SSL certificates, and any special software your site uses. If your website processes orders, bookings, or user registrations, plan the migration carefully so that new data is not overwritten during the transfer.
Step 1: Create a Complete Backup of Your Website
Before you migrate a WordPress site to new hosting, create a complete and restorable backup. It should include both the website files and the database. Having only one of these is not enough to reproduce the complete site.
Back up the website files
Use your hosting file manager or an FTP/SFTP client to download the WordPress installation.
This normally includes the wp-content directory, WordPress configuration
files, and the other files in the installation root. The wp-content directory
is especially important because it contains themes, plugins, and uploaded media.
Back up the database
Open phpMyAdmin or the database management tool provided by your hosting company. Select the database used by WordPress and export it as an SQL file. For many websites, the default export settings are sufficient, but large databases may require a different export method or adjustments to server limits.
Store the backup somewhere separate from both hosting accounts when possible. Check that the downloaded files are present and that the SQL export is not empty. A backup is only useful if it can be restored.
Prefer a professional migration?
Move Your WordPress Site Without the Guesswork
Get help transferring your WordPress website to new hosting, with attention to files, database settings, and post-migration checks.
Order WordPress Migration on KworkStep 2: Prepare Your New Hosting Account
Sign in to the new hosting control panel and create or select the website environment where WordPress will run. Depending on your provider, this may involve adding a domain, creating a website directory, selecting a PHP version, and enabling a database service.
If you are keeping the same domain, you may be able to add it to the new account before changing the public DNS records. Some hosting providers require domain ownership verification or specific setup steps. Follow the provider's instructions.
Create a new database and database user
In the hosting control panel, create a database and a dedicated database user. Grant the
user the permissions required by WordPress for that database. Record the database name,
username, password, and database host. The database host is often localhost,
but this depends on the hosting provider.
Avoid assuming that database names and usernames will be identical on the old and new hosting accounts. Some providers automatically add an account prefix. You will use the actual values from the new host in the WordPress configuration file.
Step 3: Transfer Your WordPress Files
Upload the backed-up WordPress files to the document root of the new website. You can usually do this through the hosting file manager or an FTP/SFTP client. If you have a large site, uploading a compressed archive and extracting it on the server may be faster, if your host supports that method.
- Open the correct destination directory for your domain.
- Upload the WordPress files or the backup archive.
- Extract the archive if necessary.
- Check that
wp-admin,wp-includes, andwp-contentare in the expected location. - Confirm that
wp-config.phpis present and will be configured for the new database.
A common mistake is uploading the files into an extra nested folder. For example, the
server may end up with public_html/backup/wordpress/ instead of the intended
document root. If the domain points to the wrong directory, the website may display an
empty page or a directory listing.
Keep permissions consistent with your hosting provider's recommended WordPress settings. Do not make every file writable as a quick fix; overly broad permissions can create a security risk.
Step 4: Import the WordPress Database
The database stores your posts, pages, settings, user accounts, and much of the content generated by WordPress plugins. The file transfer alone will not reproduce your site. Import the SQL backup into the database you created on the new hosting account.
- Open phpMyAdmin or the database import tool on the new host.
- Select the destination database, making sure it is the correct one.
- Use the import function to upload your SQL backup.
- Wait for the import to finish and review any error messages.
- Check that the expected WordPress tables are present.
If the database is too large for the web interface, your host may provide a command-line import method or another supported tool. Timeouts, file-size limits, and character-set problems can prevent an import from completing successfully.
Step 5: Update the wp-config.php File
WordPress uses wp-config.php to connect to its database. After moving to a
new hosting provider, the database credentials in this file may need to be updated.
Look for the following configuration constants:
define( 'DB_NAME', 'your_new_database_name' );
define( 'DB_USER', 'your_new_database_user' );
define( 'DB_PASSWORD', 'your_new_database_password' );
define( 'DB_HOST', 'your_database_host' );
Replace the example values with the exact credentials provided by your new host. The snippet is illustrative: preserve the rest of your existing configuration, including authentication keys and salts, table prefix, and any site-specific settings. Do not replace the entire file with this short example.
Keep the configuration file private and never publish database passwords. If the site uses a custom table prefix, make sure it matches the imported tables. A mismatch can prevent WordPress from finding its existing content.
Need help with the technical steps?
Let a Specialist Handle the Transfer
If you are unsure about database credentials, server paths, or configuration files, professional migration can help reduce the risk of errors.
Get WordPress Migration HelpStep 6: Test Your Website Before Changing DNS
Whenever possible, test the migrated website on the new server before directing normal visitor traffic to it. Your hosting provider may offer a temporary URL, staging environment, or preview feature. Another option is a local hosts-file override, which requires technical care and should be used only if you understand how to revert it.
A temporary preview URL may not reproduce the final domain's cookies, redirects, SSL behavior, or URL structure exactly. Use it for preliminary checks, then test again using the real domain after DNS and HTTPS are configured.
Use this testing checklist
- Open the homepage and several important internal pages.
- Check images, downloadable files, and embedded media.
- Sign in to the WordPress dashboard.
- Confirm that themes and essential plugins are active.
- Test contact forms, search, menus, and important user flows.
- Review permalinks and look for broken internal links.
- Check for PHP errors, missing assets, and unexpected redirects.
- Verify that the correct domain and HTTPS settings are used.
If the site uses caching, clear the relevant caches after the transfer. You may need to refresh the browser cache as well. For complex websites, test payment gateways, scheduled tasks, API integrations, membership features, and other functions specific to the project.
Step 7: Update Your DNS Settings
Once the new website has been tested, update the domain's DNS records so visitors reach the new hosting server. Depending on your setup, this may mean changing the A record, updating an AAAA record, or changing nameservers. Follow the exact configuration instructions from your new hosting provider.
DNS changes do not become visible everywhere instantly. During propagation, different visitors may temporarily reach different servers. The transition time depends on record TTL values, resolver caches, and the specific changes made.
Lowering a DNS record's TTL ahead of a planned migration can sometimes help shorten the transition, but it should be done in advance and does not guarantee immediate propagation. Do not change email-related MX, SPF, DKIM, or DMARC records unless your email setup also requires it. Incorrect changes can interrupt business email.
Step 8: Complete the Final Checks
After DNS points to the new host, revisit the site using its normal domain. Confirm that the correct server is serving the website and that HTTPS works without certificate warnings.
If the domain uses an SSL certificate, make sure it covers the required hostname versions,
such as the root domain and the www subdomain when both are used. Set up
HTTPS redirects only after the certificate is valid and the destination URLs work.
Review WordPress Site Address and WordPress Address settings if the setup requires it. Flush permalinks by opening Settings → Permalinks in the dashboard and saving the settings when appropriate. This can refresh rewrite rules, but it will not fix every server or URL problem.
Finally, check analytics, search engine verification, scheduled tasks, backups, caching, security tools, and uptime monitoring. Keep an eye on error logs and user reports for several days before removing the old hosting environment.
Want a smoother hosting migration?
Get Your WordPress Website Moved Professionally
Save time on the technical work and get help with transferring website files, database configuration, and post-migration testing.
Order the Migration ServiceCommon WordPress Migration Problems and How to Fix Them
1. Error Establishing a Database Connection
This error often means that the database credentials are incorrect, the database server
is unavailable, or the database user lacks the necessary permissions. Recheck the values
in wp-config.php, confirm the database host with your provider, and verify
that the imported database exists.
2. White Screen or HTTP 500 Error
A blank page or server error can result from a PHP incompatibility, plugin conflict, incorrect permissions, memory limits, or a server configuration issue. Check the hosting error logs first. If necessary, troubleshoot plugins and themes in a controlled way, and avoid disabling security protections without understanding the consequences.
3. Images or CSS Files Are Missing
Check whether the wp-content/uploads directory and theme assets were copied
correctly. Confirm that the domain points to the intended document root and that the
URLs in the page source refer to the correct location. Mixed-content warnings may also
occur if a site loads resources over HTTP while the page uses HTTPS.
4. WordPress Redirects to the Old Website
This can happen if the WordPress URL settings, database values, redirects, or cached configuration still reference the previous location. If the domain has not changed, investigate the server and cache configuration before performing a URL replacement. If the domain has changed, use a WordPress-aware search-and-replace method that handles serialized data correctly.
5. The Website Looks Different After Migration
Clear the browser, WordPress, server, and CDN caches where applicable. Check whether the correct theme and plugins are active and whether all generated CSS and media files are available. If the layout is still broken, inspect the browser console and server logs for missing files or JavaScript errors.
Frequently Asked Questions
How long does it take to migrate a WordPress website?
A small website may be transferred in a few hours, while a large or complex site can require significantly more time. File size, database size, server access, email configuration, and testing requirements all affect the schedule.
Will my website go offline during migration?
Downtime can often be minimized by preparing and testing the new copy before changing DNS. However, zero downtime cannot be guaranteed in every setup, especially for sites with frequent updates, online orders, or complex integrations.
Do I need to change my domain name?
No. Moving WordPress to new hosting does not require a new domain. If the domain stays the same, you normally update the relevant DNS records after testing the destination.
Will I lose my posts, pages, or images?
They should remain intact when the database and files are transferred correctly. A complete backup and careful validation are essential. Sites that receive new orders, comments, or registrations during migration need additional planning to avoid losing recent data.
Do I need to reinstall WordPress on the new server?
Not necessarily. You can usually migrate the existing WordPress installation by copying its files and database and configuring the new environment. Some managed hosting providers offer their own migration tools or require a specific import process.
Will migrating hosting affect SEO?
A hosting change alone does not require changing your URLs. Search visibility can be affected if the site becomes unavailable, pages return errors, redirects are incorrect, or important content and metadata are lost. Test the website and monitor indexing and traffic after the migration.
Should I keep my old hosting account?
Yes, until you have verified the new website, confirmed DNS propagation, checked important functionality, and secured a final backup. If email or other services use the old account, confirm their migration separately before cancelling it.
Can I migrate WordPress without technical experience?
It is possible, especially with a reliable migration plugin or a host-provided tool. However, manual transfers involve files, databases, configuration, and DNS. If the website is business-critical or you are unsure how to recover from an error, professional help may be the safer option.
WordPress Migration Service
Ready to Migrate Your WordPress Site?
Get assistance moving your WordPress website to new hosting, another server, or a new domain. Share your requirements and hosting details before the transfer so the migration can be planned correctly.
Hire a WordPress Migration SpecialistHave questions about your setup? Contact the service provider through Kwork before ordering.