Migrating Your WordPress Site

If you already have a working WordPress site that you wish to move to Pendeo, this guide will explain how to move it.

Overview

  • Prepare your existing site
  • Import your database to Pendeo
  • Update the $table_prefix variable in wp-config.php
  • Copy your site theme, plugins and uploads folders from your existing site to your site on Pendeo.
  • Reset your Pendeo file permissions
  • Update all instances of the existing WordPress Address (URL) in the database – Read this article to see how to update your Table Prefix.

Important – this guide assumes your new Pendeo WordPress site where you are migrating to is blank, and has no existing content or themes installed. If you already have content you should copy it to the source site before proceeding.

You might also like to read this article first to get a solid understanding of your migration options, before proceeding with the steps below: Migrating WordPress Across Hosts, Servers, and URLs

You will need to know:

  • your Pendeo sFTP username and password - found in the Control Panel
  • your Pendeo Database Admin URL - found in the Control Panel
  • your database username and password – this can be found in your site’s wp-config.php file – use sFTP to access your site, download the wp-config.php and open it in an editor – the following lines contain the information you need:

define('DB_USER', 'Username');

define('DB_PASSWORD', 'Password');

A WordPress website consist of 2 main components:

  • The code that lives on the web server
  • A database that holds information

Step 1 – Prepare your existing site

Working on your existing site, please perform the following steps in the following order:

  1. Make a backup of your existing website code. You should be able to do this using an FTP client. In the picture below, the example WordPress website lives on the server at: wordpress_5.5-evaluate. This is the directory that I installed wordpress into. To make a complete backup of your existing wordpress website code, you will need to copy the top installation directory (probably called wordpress) and all the files in it, and the three directories called, wp-admin, wp-content and wp-includes plus all their contents to your machine.

  2. Perform an upgrade of WordPress for your existing site, to the same version of WordPress which is running on Pendeo where you will be migrating your current site to
  3. Remove all plugins and themes you are no longer using
  4. Remove any caching or backup plugins as these are not allowed on Pendeo
  5. Make a database dump of your existing WordPress site and save to your computer. You may need to request this from your existing hosting provider if you do not have the facilities to make a database dump yourself.

Step 2 – Import your database into Pendeo

Important – this step will result in all data in your Pendeo site’s database being overwritten with the data from your existing site. From now and until you complete the final steps, your site will not be accessible.

Working on your Pendeo site, do the following:

  1. Login to your Database Admin using your database username and password.
  2. Create a database dump as a backup.
  3. Delete [drop] all existing tables.
  4. Import the existing site database dump - please see note below
  5. Confirm that all tables have been imported
  6. Make a note of the table prefix being used – this will be something like “wp_” or some other string prefixing each table name.

NB: If your existing site has been in use for a while, this means that the database dump you made in Step 1:5 will now be out of date - so your best option is to make a fresh database dump just prior to importing it into your new Pendeo WordPress website and your new Pendeo website going live.

Step 3 – Update $table_prefix variable in wp-config.php

Important – for improved security, you should not use “wp_” as your table name prefix. If the tables imported in Step 2 have this prefix, we recommend renaming them with a random string before proceeding below. Here’s an article explaining how to change your WP database table prefixes.

If you don’t need to change your table name prefixes, you simply need to update your installation with the newly imported table prefix - here’s how:

sFTP to your Pendeo site and edit wp-config.php, updating the $table_prefix variable to match the prefix of the newly imported tables. For example if your newly imported tables have the prefix ‘hbswm_’, then your variable would like this:

$table_prefix = 'hbswm_';

Save wp-config.php back to your Pendeo site.

Step 4 – Copy your existing site theme, plugin and upload folders to Pendeo

Working in Pendeo, do the following:

Important – do not copy the entire wp-content folder from your existing site, it is important that you copy only the specified folders

  1. Use sFTP to download a copy of your new Pendeo site’s wp-content folder and store it somewhere safe as a backup.
  2. Use sFTP to upload the content from the following folders of your existing site that you backed up in Step 1
    • wp-content/uploads
    • wp-content/plugins
    • wp-content/themes

Step 5 – Reset your file permissions

Use the Control Panel to reset the file permissions.

Step 6 – Update all instances of the existing WordPress Address (URL) in the database

If you are changing the site URL (your WordPress Address or Site URL) you will need to use the Interconnectit Search and Replace tool to search for and replace all instances of your old WordPress Address (URL) to match the URL you want to use for your site.

You can find your existing site’s WordPress Address by looking in the General Settings of your existing site’s WP-Admin.

To work out what strings to enter into the Search and Replace tool, read the following examples and then proceed according to the instructions below.

Example 1 – your existing site (the site you copied) had the URL of  www.example.com. You are migrating to Pendeo and want to use the development URL which is www.example.com.wp.pendeopress.com so that you can carry on development. In this case you would enter, without quotes: “www.example.com” in the search box and “www.example.com.wp.pendeopress.com” in the replace box.

Example 2 – your existing site (the site you copied) had the URL of  www.example.com. You are migrating and want to use example.com. In this case you would enter, without quotes: “www.example.com” in the search box and “example.com” in the replace box.

Example 3 – your existing site (the site you copied) had the URL of  www.example.com. You are migrating and want to use www.anotherdomainentirely.com. In this case you would enter, without quotes: “www.example.com” in the search box and “www.anotherdomainentirely.com” in the replace box.

Example 4 – your existing site (the site you copied) had the URL of  www.example.com. You are migrating and want to use the same domain name. In this case you do not need to do anything.

To update your database with the correct URL, working on your Pendeo site, do the following:

  1. Download Interconnectit Search and Replace tool
  2. Extract the php file and rename it to something random – for example “xywjsydhe.php”
  3. sFTP the renamed file to the root of your site, then browse to the URL of the file e.g. yourpendeosite.dom/xywjsydhe.php
  4. You’ll be presented with the option to populate the database details – do this and continue following the instructions.
  5. At the point at which you can select the tables to modify, make sure all your tables are chosen (click on the first table name then hold shift and hit the down arrow key to highlight them all). We would also recommend clicking the option to exclude making changes to the GUID field as in most circumstances this should never be changed.
  6. At the Search and Replace point, you should type in the old URL to search on and then in the replace field, type in the new URL.
  7. Triple check what you entered, making sure that you didn’t accidentally add any spaces before or after each string in the search and replace boxes, then proceed to complete the script.
  8. After it completes, the script will show you how many modifications were made. You can verify that it’s done what you expected by checking that links between pages are linking to the new URL and not the old.
  9. Use sFTP to delete the script from your site.

Important – After you have finished with the script, you must delete it. This is very important otherwise anyone who finds it on purpose or by accident will have carte blanche to make changes to your database!

You should now be able to login to wp-admin on your site. 

Recommended reading:

Related Links: