WordPress Theme Migration

Many people prefer to develop their site on a production server and then shift the site to the live server. During migration mostly people face issues related to broken images paths, links, missing files and consider it as a tedious work. Shifting your site content from the production server to a live server requires technical expertise since during migration process if your site content is not migrated properly then it may result in broken paths of media, missing files, database tables may get corrupt and your site may looks broken and you may lose significant number of visitors on your site as well.

Take backup of Files

  • If you are moving WP theme from one server to another, it is good to begin by backing up your WordPress directory, images, plugins, and other files on your site as well as the database.

How to migrate WP theme

There are different ways of migrating WP theme from one hosting to another hosting or from production server to the live server. Every technique has its pros and cons. The most common way of migrating WP themes is described below.

Migration through WP plugin

WP theme migration consists of different steps. If the steps are followed carefully then your site will be migrated successfully without getting into any problems. The steps are described below.

1. The first step is to export the database of the theme which you will be migrating. You can simply access your production server and export the database along with all tables and save the database file with .sql

2. The second step is to zip the theme folder which will be located at the following path.

wp-content/themes

3. The third step is to copy the plugins which you can find at the following path. If the theme contains its own plugins and you haven’t customized them then you don’t have to copy those plugins which are already shipped with the theme. You can only copy those plugins which you are using other than the plugins which are already shipped with the theme.

wp-content/plugins

4.The fourth step is to copy the upload folder which contains your media files such as images and is located at the path described below.

wp-content/uploads 

Note

The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.

Solution for changing URLs in database

If you need to change the URLs of your media files such as images links in your database then you can use WordPress plugins which can help you in changing the URLs inside your database safely without any issue. There are many tools which can be used in changing the URLs but the most common tools which are widely used are described below.

  1. You can use the Velvet Blues Update URLs plugin if you can access your WP admin dashboard.
  2. Better Search Replace plugin is a good plugin for changing URLs you can use this plugin if you can access your WP admin dashboard.
  3. WP Migrate DB exports your database as a MySQL data dump which is similar to the phpMyAdmin and can help in finding and replacing on URLs and file paths, handles serialized data and allows you to save it to your computer as an SQL file.

Migrating WP theme to target site

  1. First step is to install WordPress on target site server where you will be shifting the site content.
  2. The second step is import the database of origin site by accessing phpMyAdmin which you have exported onto to the target site and refresh the page and your site will be migrated successfully.
  3. Third step is to copy the theme of origin site and upload the theme via FTP or CPanel in the themes directory which is located at the path wp-content/themes.
  4. Fourth step is to copy the plugins of origin site and upload them via FTP or CPanel in the plugins directory of your theme which is located at the path wp-content/plugins.
  5. The last step is to copy and replace the uploads folder which contains your media files onto your target via FTP or CPanel which is located at the following path wp-content/uploads.