Move WordPress to new hosting without changing your domain
This guide moves WordPress to new hosting without changing your domain or site URL. You will move two parts together: the files and the database.
Files contain themes, plugins and images. The database holds records such as posts, users and orders. Moving only one part is not enough.
A domain change, Multisite network or large WooCommerce store needs additional planning. Moving hosting does not require changing your domain registrar.
The new site needs its content and application files together.
The domain stays the same; files and database move to the new host.
- Files
Themes, plugins, images and configuration such as wp-config.php.
- Database
Posts, users, settings and store orders where applicable.
Take files and database from the same migration point. A WordPress content export alone is not enough.
Before you start
Have ready: Access to both hosting accounts, a WordPress administrator account, file/database backups and the current DNS records.
- Record the old environment's PHP version, required extensions, storage and active plugins. PHP is the software that runs WordPress on the server.
- Check that the new environment supports these requirements. Tools such as cPanel depend on the service.
- Before transferring files, protect web access to the new environment with authentication or IP restrictions.
- Before opening the new copy, restrict real email, payment/API activity and automatically scheduled jobs for testing. If you do not know how to do this, obtain technical assistance before running it.
A preview address is not access protection: A temporary hosts entry changes which server your own computer reaches. It does not stop other people reaching the new server. noindex does not provide access protection either.
For sites accepting orders, payments, comments or registrations, decide when to take the final backup and which server will accept new records. A maintenance page may not stop every write, including API requests or payment notifications.
1. Back up files and the database together
Where? In the old hosting account.
- Copy the WordPress directory, including uploaded images, themes and plugins.
- Check that hidden
.htaccessand thewp-config.phpconfiguration are included. - Export the database separately as an SQL file. This holds the records and instructions used to rebuild the database.
- Confirm that files and database represent the same point in the migration.
- Store the backups outside publicly accessible website folders. Keep the old hosting service active.
WordPress Tools → Export does not replace a complete file and database backup.
2. Prepare files and the database on the new host
Where? In the new hosting account.
- Find the domain's document root: the folder from which its files will be published.
- Transfer files into that folder. Do not accidentally extract an archive into an extra subfolder.
- Create a new database and a user authorised for that database.
- Import the SQL backup into the new database. Use a user with access only to that database, without access to production databases. If the dump contains
USEorCREATE DATABASEtargeting the source, follow the safe import check first. - Open
wp-config.phpin the new copy and update its connection settings for the new account.
| Setting | What to enter |
|---|---|
DB_NAME | Full new database name, including any account prefix |
DB_USER | User authorised for the new database |
DB_PASSWORD | That user's password |
DB_HOST | Database host required by the new service; change if needed |
Do not publish this file or its passwords in public support channels.
3. Test the new copy under the same domain
Where? In your own computer's browser, using a preview method that reaches the new copy.
- Use a preview method supplied with the service or a temporary hosts entry on your computer. This opens the new server with the same domain before changing public DNS.
- Check that the new environment also has a valid HTTPS certificate matching the domain. Bypassing a browser warning is not a successful test.
- Test the actions below on the new copy. Do not create real customer notifications, payments or duplicate orders.
| Check | What to verify |
|---|---|
| Content | Home page, older posts, images and downloads open |
| Administration | Administrator sign-in and saving a draft work |
| URLs | Permalinks, the addresses of internal pages, still open at the existing URLs |
| Forms | A controlled notification reaches your chosen test recipient |
| Background tasks | Scheduled jobs and external connections suit the test environment |
Since the domain is unchanged, you do not need to replace every database URL or change the WordPress addresses. For a domain change, follow the WordPress migration instructions. Simple SQL replacements can damage serialized data, which stores values with formatting such as length information.
Give each environment a separate role during testing.
- Old site · Visitors
Public DNS still points to the old server; the live site runs here.
- New copy · Your test
Access is restricted. Use a preview or temporary hosts entry for controlled checks.
A hosts entry affects only your computer. Restrict access, notifications and payment actions on the new copy separately.
4. Transfer final changes and update DNS
- If the old site received new data during testing, transfer the final file/database changes under your maintenance plan.
- Check the final copy again.
- At the authoritative DNS provider, update the relevant A/AAAA records: the website's server addresses.
- If changing nameservers, first complete the DNS migration checklist.
- Preserve email records if mail stays with its current provider.
5. Verify the live site and search access
- Remove the temporary hosts entry from your computer.
- Open the site through your normal connection.
- Test HTTPS, administrator sign-in, forms and important content URLs.
- Remove test access restrictions as appropriate for launch. Check for leftover
noindexsettings and review WordPress search engine visibility. - Do not create unnecessary redirects when the URLs are unchanged.
Expected result: Visitors reach the new server at the existing URLs, and the site has not accidentally been blocked from search engines.
Expected result, errors and rollback
Existing URLs should open on the new server, current content should be present and new records should go into the correct database.
- “Error establishing a database connection”: Check the new
wp-config.phpvalues and database user permissions. - The home page works but internal pages return 404: Review permalink settings and the web server's rewrite rules that handle page addresses.
If you need to roll back: Check whether orders and content created on the new site also exist in the old database. Restoring DNS alone does not move those records. Do not overwrite one database with the other without reconciling the data. Retire the old environment only after verifying the new site and its records.