If you need to transfer your WordPress website then there are certain steps you must take in order to migrate your website successfully.

It’s easy to miss out an important task, so I’ve put together this handy step-by-step guide for migrating your WordPress website from server A to server B. For this example we will use:
‘old_wp’ for the WordPress database we are moving
‘new_wp’ for the new WordPress database we are moving our data to

1) Export the database of the WordPress website you would like to move

  • Login to PHPMyAdmin
  • Select the database you would like to export
  • Select ‘Export’ on the tabs at the top
  • Leave your settings as default and export the SQL dump to your computer (this will create a .sql file which you will need later)

2) Download all your WordPress files

  • Open your favourite FTP editor (if you don’t have one try Filezilla)
  • Select all the files in the root directory, usually ‘public_html’ or ‘www’
  • Download these files to your computer

3) Create a new database on the server you are moving your WordPress website to

  • Access cPanel for the hosting you are moving your WordPress website to
  • Create a new database, user and password (this example uses Pickaweb.co.uk)
  • Write down these details, along with the database hostname (usually ‘localhost’)

4) Edit the SQL file

  • Open the .sql file you exported earlier, in an editing program like Notepad++
  • If your .sql file has a line containing ‘CREATE’, you can comment this out
  • Change any links pointing to the name of the old website address to the new one using Interconnectit or similar
  • Save the .sql file
    Note: Don’t just do a search and replace on Notepad++, you could break serialised data

5) Edit the WordPress configuration file

  • Make a backup of your wp_config.php file and save it
  • Open the original wp_config.php from your downloaded copy of the old site from Step (2)
  • Change your database details (database name, user, password and hostname) to your new details from Step (3)
  • Save the wp_config.php

6) Import your .sql file into PHPMyAdmin

  • Open PHPMyAdmin
  • Select the database you created in Step (3)
  • Import the .sql file you edited in Step (4)

7) Transfer your updated files onto your new server

  • Open your favourite FTP editor (skip this step and the next two if you are using a new empty server)
  • Now copy over the WordPress files you downloaded in Step (2) and edited in Step (5), from your computer and onto the new web server

8) Open your new website and update ‘Permalinks’

  • Log in to the WordPress admin area (the details will be the same as previously)
  • Update your permalinks

9) Finally…

Test any redirects you have set up and remember if you are redirecting pages outside of your current WordPress installation, the standard default on many WordPress redirect plugins will redirect WordPress pages/posts and not web pages outside of your WordPress install.

To setup redirects outside of your WordPress installation, you need to use either 301 redirects on your cPanel or configure the WordPress plugin to write to your Nginx or Apache setup.

Leave a Reply

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