Last Updated: November 21, 2021
· sluzky

Moving a WordPress site between hosts

I have recently had to move some WordPress sites from on host to another.
I couldn't find a complete guide to actually perform this simple task, so here are my conclusions.

Just to make everything clear, I have a WordPress site fully developed on a development host (could be local) let's call it source host, and I want to move it to the host where the website is going to live on (production), let's call it target host.

  1. Go to the MySQL database management system on the source host (I use phpMyAdmin)
  2. Choose the database for the wordpress site (usually [name]_wordpress)
  3. Export the database into an SQL file and save it somewhere
  4. Edit the SQL file using your favorite text editor, Notepad++ seems to work best for big text files
  5. Search/Replace the source host address to the target host address, i.e localhost/wordpress_site -> hostfulladdress/wordpress_site
  6. If you're moving to the root of the website on the target host then you'll replace localhost/wordpress_site to hostfulladdress
  7. Log in to the target host's MySQL database management system on the target host and create a new database for the wordpress site
  8. Select the new database and import the edited SQL file into the database, see that all tables were created
  9. Go to the source host's file management system
  10. Go to the wordpress site's directory, zip it up into a zip file
  11. Download the zip file and copy it over to the target host, into the directory you want the site to be in (should be the same directory as in step 2/3)
  12. Unzip the site's zip file in that directory
  13. On the target host edit the file named wp-config.php
  14. The main fields to change in that file are DB_NAME , DB_USER and DB_PASSWORD , fill them according to the target host's details

That's it, the site should be up and running on the target's host in the directory you unzipped it in

1 Response
Add your response

This method breaks serialized data.

An easy solution is uploading your sql-dump to instead of manual search-replace.

over 1 year ago ·