DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Migrate a WordPress Site to Another Hosting Provider Without Losing Data

Move WordPress safely by backing up files and the database, preparing a compatible destination, transferring and correcting URLs, testing with a hosts-file entry, and keeping the old host online through DNS propagation.
Length13 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Move a WordPress site by making a complete backup, preparing a compatible database on the new server, transferring the files and SQL database, correcting configuration and URLs, testing privately, and changing DNS only after the copy works. Keep the old hosting account active for several days after the DNS change so visitors still have somewhere to go while records update.

This guide covers both a manual migration and a migration-plugin workflow. The manual method works for any site and gives you complete control; a plugin is usually faster, but free import limits or a very large backup can make manual transfer the better choice.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need before moving a WordPress site

A migration is a coordinated move of two things: the WordPress files and the database. The files contain WordPress core, themes, plugins, uploads, configuration and server rules. The database contains posts, pages, users, settings, menus, comments and much of the content created by plugins. Moving only one of them produces an incomplete site.

Access and information to collect

  • Administrator access to the existing WordPress dashboard.
  • FTP or SFTP credentials for the old and new servers, or the new host’s file manager.
  • Access to phpMyAdmin (or an equivalent database tool) on both hosts.
  • Access to the domain registrar or DNS manager.
  • The new server’s IP address or nameservers.
  • The current database name, database user and database password, found in wp-config.php.
  • The PHP and MySQL versions supported by the old site and offered by the new host.

Do not cancel the old account or change DNS at the start. The old server is your fallback and may still receive visitors while the move is being tested.

Choose a low-traffic maintenance window

Copying a site while people are publishing posts, submitting forms or placing orders can leave the new database behind the old one. Schedule the final backup for a quiet period. If the site accepts important submissions, temporarily pause those activities or plan a final database export immediately before the DNS change.

Plugin migration or manual migration?

Both approaches are valid. Choose based on the site’s size, your access and how much control you need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Criterion Migration plugin Manual transfer
Speed Usually faster because files and the database are packaged and restored through WordPress. Slower: you copy files, create a database, import SQL and edit configuration separately.
Technical skill Lower, provided the backup fits the plugin’s import method and the dashboard remains usable. Higher; you must work with FTP/SFTP, phpMyAdmin and wp-config.php.
Large sites or free limits A plugin’s free import limit or server upload limit can block restoration. Works for sites that exceed a plugin limit, subject to the new server’s storage and database limits.
Control Automation reduces repetitive work but hides some individual steps. Complete control over which files, database and URL changes are transferred.
Main risks Import timeouts, incompatible packages and an incomplete restore. Incorrect database credentials, missing files and unsafe URL replacement, especially with serialized data.

Common plugin choices

Guides commonly use Duplicator, All-in-One WP Migration or UpdraftPlus. Install one on the existing site, create a full package or backup, install a clean WordPress instance on the new host when the plugin requires it, and restore the package there. Follow the plugin’s current import limits and server requirements; those limits and interface labels can change by edition and version.

Step 1: Make and verify a complete backup

Do this before creating a new database or changing DNS. Keep the backup outside the old hosting account so a failure at the old provider cannot remove your only copy.

Back up the WordPress files

  1. Connect to the old server with FTP, SFTP or its file manager.
  2. Download the entire wp-content directory. It includes themes, plugins and uploads, and may also contain custom files created by the site.
  3. Download wp-config.php. It contains the database connection details you will adapt for the new server.
  4. Download .htaccess if it exists. On many servers it is hidden, so enable “show hidden files” in the FTP client.
  5. For a complete manual copy, download the remaining WordPress root files as well. Do not assume a fresh installation contains custom root-level files.

Record the size of the downloaded directories and compare it with the server copy. A transfer that silently omits an uploads subdirectory can leave older media broken even though the homepage appears to work.

Export the database

  1. Open phpMyAdmin on the old host and select the database used by the site. The database name and table prefix are shown in wp-config.php.
  2. Choose Export, select Quick, and use the SQL format, as described in the standard migration workflow.
  3. Download the resulting .sql file and keep it with the file backup.

If the database tool offers a custom export for very large databases, use a method that completes successfully on your host, but do not omit tables. The database and files must represent the same point in time as closely as possible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Record settings that are easy to forget

  • The current domain, including whether the site uses www.
  • Whether the site is using HTTP or HTTPS.
  • The database table prefix in wp-config.php.
  • Any custom cron, redirect or server rules maintained outside WordPress.
  • The old server’s PHP and MySQL versions, so you can select compatible versions on the new host.

Step 2: Prepare the new hosting account

Prepare an empty destination before uploading anything. In the new host’s control panel, create a database dedicated to this WordPress site, then create a dedicated database user with a strong, unique password. Grant that user all privileges on the new database. Write down the exact database name, username, password and database host value; some hosts use a local value while others provide a separate hostname.

Check runtime compatibility

Confirm that the new server’s PHP and MySQL versions meet the site’s needs. Match the old environment first rather than upgrading several components during the move. Once the migrated site is stable, perform upgrades separately so a migration problem is not confused with a version-compatibility problem.

Create the destination directory

Identify the document root that will serve the domain. It may be a directory such as public_html or a host-specific path. A successful upload to the wrong directory can produce a default page or a fresh WordPress site while the transferred files remain inaccessible elsewhere.

Step 3A: Manual migration, file by file

Upload the files

  1. Upload the WordPress files, including wp-content, wp-config.php and .htaccess, into the new site’s document root.
  2. Preserve directory names, capitalization and permissions. Let the transfer finish before opening the site.
  3. If you installed a blank WordPress copy as a test, replace its files with the backed-up site files rather than leaving two competing copies in the document root.

Import the SQL database

  1. Open phpMyAdmin on the new host and select the empty database you created.
  2. Choose Import, select the exported SQL file, and start the import.
  3. Wait for the success message. An upload that reaches the browser’s size limit or times out is not a complete import; use the host’s documented large-file method rather than assuming partial tables are usable.

Update wp-config.php

Edit the copied file so its database constants match the new database:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
define('DB_NAME', 'new_database_name');
define('DB_USER', 'new_database_user');
define('DB_PASSWORD', 'strong_database_password');
define('DB_HOST', 'database_host_value');

Keep the existing table prefix unless you deliberately changed every table and configuration reference. Do not paste credentials into a public support forum or leave temporary copies of wp-config.php in a web-accessible directory.

Step 3B: Migration with a plugin

  1. Install a migration plugin such as Duplicator, All-in-One WP Migration or UpdraftPlus on the old site.
  2. Create a complete package or backup that includes the database, themes, plugins and uploads. Download every part the plugin produces; some workflows split a large backup into multiple files.
  3. On the new host, install a clean WordPress instance if the plugin’s restore process requires one.
  4. Install the same migration plugin on the destination and upload or import the package through its current restore interface.
  5. Supply the new database details when prompted and allow the restore to finish without closing the browser or deleting temporary files.
  6. Sign in with the restored site’s administrator account, not necessarily the credentials created for the blank installation.

Plugin imports can fail because of PHP memory, execution-time, upload-size or storage limits. If the package exceeds a free import limit or repeatedly times out, use the manual process or the plugin’s documented server-side restore method instead of repeatedly uploading a partial archive.

Step 4: Correct the site’s URLs safely

URL changes are the most error-prone part of a move, particularly when the domain, protocol or test address changes. A site that keeps the old URL can redirect visitors to the old host, load mixed content or show missing images.

Temporary constants in wp-config.php

The WordPress Codex guidance allows you to define the home and site URLs as constants in wp-config.php. Use the complete URL with https:// when HTTPS is active, and omit the trailing slash:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');

When these constants are defined, the General Settings screen cannot change those values. Remove the temporary definitions after the database has the correct URLs if you want to manage them from the dashboard again.

The temporary RELOCATE method

A RELOCATE constant can update the database URL when you log in through wp-login.php on the new server. The Codex warns that leaving this line in place is a security risk. If you use it, remove it immediately after the login and verify the resulting URLs.

Editing the database

You can edit the siteurl and home values in the wp_options table, but those are not the only locations that may contain the old address. Upload paths and plugin settings can require additional changes.

Never run an indiscriminate text replacement across the SQL file. WordPress themes, widgets and plugins commonly store serialized values with a length marker. Changing the text without updating that length can corrupt the serialized data and break the site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Serialization-safe replacement

Use a tool that understands serialized data, such as Better Search Replace, Velvet Blues Update URLs or WP-CLI’s search-replace command. A typical WP-CLI pattern is:

wp search-replace 'example.dev' 'example.com' --skip-columns=guid

Run a dry run first when the tool supports it, review the table and replacement counts, then execute the replacement. Do not change the guid column in wp_posts; media URLs used in page content are stored in post content and can be updated when appropriate.

A cautious Better Search Replace workflow is to define the new URL temporarily in wp-config.php, run the serialized-data-safe replacement, then delete the constant. Take a fresh database backup before a large replacement so you can restore if a plugin setting becomes invalid.

Step 5: Regenerate permalinks and server rules

After a plugin restore or a manual move, sign in to the destination dashboard and open Settings > Permalinks. Click Save Changes twice. This regenerates the rewrite rules and can recreate .htaccess for standard single-site installations. If the file is not writable, copy the rules WordPress displays into the destination server’s configuration using the host’s supported method.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 6: Test the new server before changing DNS

Testing privately reduces downtime. Use a hosts-file entry on only your own computer that maps the domain to the new server’s IP address. The exact file location depends on the operating system; add one line containing the new IP, a space and the domain, then save the file and clear the local DNS cache if necessary.

  1. Open the site in a private browser window so cached redirects do not hide errors.
  2. Check the homepage, several page and post templates, category archives and search.
  3. Log in and log out with an existing user account.
  4. Open the media library and older posts; confirm images, downloads and thumbnails load.
  5. Submit every important form and verify the expected confirmation or notification behavior.
  6. Follow internal links and redirects, including HTTP-to-HTTPS and non-www variants.
  7. Check plugin and theme settings, scheduled tasks and any custom functionality that reads from the database.
  8. Review the browser console and server error log for fatal PHP errors, missing files or mixed-content warnings.

Remove the hosts-file line when testing is finished. It affects only the computer on which it is set, so it does not switch the site for visitors.

Step 7: Switch DNS with a rollback plan

When the destination passes testing, change DNS using the method specified by the new host: replace the domain’s nameservers at the registrar or point the relevant records to the new server’s IP address. Do not change unrelated mail records unless your email service is moving too.

DNS propagation is not instantaneous. One migration guide cites a 48-hour window, but that figure is not tied to a named authority and propagation often settles sooner. During the transition, different visitors may reach different servers because resolvers cache records for different periods.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reduce the chance of split-site data

  • Take the final database backup immediately before the DNS change.
  • Stop publishing or pause transactions during the final cutover if losing a submission would be serious.
  • Do not make content changes on the old and new copies at the same time.
  • Keep the old host active for a few days after the DNS change.

Monitor both servers during propagation. If a serious problem appears, you can temporarily point DNS back to the old host while repairing the destination, provided the old copy is still intact.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Post-migration verification and safe decommissioning

After DNS changes, test from a network that is not using your hosts-file override, such as a phone on cellular data. Repeat the critical checks: pages, logins, forms, images, redirects and HTTPS. Confirm that the domain resolves to the new IP from more than one resolver if you have access to those checks.

Keep the old hosting account and its files for several days until traffic is consistently reaching the new server and no delayed DNS users report errors. Only then remove the old site or cancel the old plan. Retain the final backup and the new database credentials in a secure password manager.

Troubleshooting common migration failures

“Error establishing a database connection”

  • Recheck DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php.
  • Confirm the database user exists and has all privileges on the selected database.
  • Verify that the imported database is the one named in the configuration and that the import completed.
  • Check that the new server’s MySQL service is running and accepts the specified host value.

Homepage works but inner pages return 404

Open Settings > Permalinks and save twice to regenerate rewrite rules. Confirm that .htaccess was transferred and is readable, or apply the equivalent rewrite configuration required by the new server.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Images or downloads are missing

Confirm that the entire wp-content/uploads directory was copied, including older year and month folders. Check that URL replacement did not leave references to the old domain, and verify file permissions and case-sensitive filenames on the new server.

Login redirects to the old host

Inspect WP_HOME and WP_SITEURL, the home and siteurl values in wp_options, and any redirect plugin settings. Remove temporary constants only after the database contains the intended URL.

Fatal errors appear after the move

Temporarily disable the suspected plugin by renaming its directory inside wp-content/plugins, then review the PHP error log. Compare PHP versions with the old server and restore the compatible version before attempting plugin or theme updates.

Only some visitors see the old site

This is usually DNS propagation or a cached resolver. Leave the old host online, verify the new DNS records, and test from another network. Do not edit content separately on each server while visitors are split between them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Special case: WordPress Multisite

The database-editing instructions for siteurl, home and related values apply to a single-site installation. Multisite has network-specific tables, domain mappings and serialized settings, so it requires manual database edits and a network-aware migration plan. Treat a Multisite move as a separate project: inventory every mapped domain, back up the entire database, and verify each site in the network after the DNS change.

A concise cutover checklist

  • Complete file backup includes wp-content, wp-config.php, .htaccess and the remaining required WordPress files.
  • SQL export is stored outside the old host and can be opened or verified as a complete export.
  • New database, dedicated user, strong password and all privileges are ready.
  • PHP and MySQL versions are compatible with the site.
  • Files and database are transferred by either a completed plugin restore or a verified manual process.
  • Database credentials in wp-config.php match the destination.
  • URL replacement uses a serialization-safe tool; guid values are untouched.
  • Temporary URL or RELOCATE constants are removed after use.
  • Permalinks are saved twice and rewrite rules work.
  • Pages, logins, forms, images and redirects pass private testing.
  • DNS is changed only after testing, and the old host remains active for several days.

Which migration method should you use?

Use a plugin when the site is a typical single installation, the backup fits the plugin’s limits and you want the quickest repeatable process. Use the manual route when the site is larger than the available import limit, the dashboard cannot create a package, or you need precise control over files and SQL. In either case, the non-negotiable safeguards are the same: keep an independent backup, prepare the destination database first, use serialization-safe URL replacement, test through a private hosts-file mapping, and delay cancellation of the old host until DNS has settled.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.