IronEggShell

Wordpress and Linux

How to Migrate changes from one theme to another

So all those great customizations were lost when you migrated to a new theme on your WordPress website.

Your customization panel is all blank fields. 🙁

Face it. Some of them you may have to replace or copy to another customization field.  Themes don’t just have a one to one correspondence. Distinct customization fields are one of the things that make different themes unique! Also, when updating to a more advanced version of the theme you will find that there are so many extra options in the upgrade that the site still doesn’t look the same if your options are imported.  There is just so much extra and allot of work will need to be done to disable or enable options that just weren’t in the original theme.

The only time that importing theme options will work cleanly is when importing into a child theme.

Sometimes you can get some of them back but it takes a little work directly with the database.

To find and fix the old customizations you can follow the following somewhat technical steps.

  • 1. Backup your site

First off, one should always perform backups before starting this sort of operation. Backups should be performed on a regular basis anyway so If you don’t already have a method of backing up, checkout this article.  It is highly recommended that you  have a full backup before proceeding.

  • 2. Add a plugin to allow access to your database

There are several ways to do this but for the average user we will want to do all the steps with tools found inside wordpress and your usual desktop tools.

Find a plugin in the Add New Plugin page that allows you to gain access to your database. I have found that ARI Adminer works well.

Install the plugin and activate it.

  • 3. Find theme_mods_ in your database

You will probably need to refresh the page and then find the “ARI Adminer” menu item and under that click “Run Adminer” and it will give you options. Select “Run Adminer in a new window”.

When the new window opens you should see some menu items on the left that are the tables in your database. Find the table name that ends in “_options” .  The first part before the “_options” could be absolutely anything so don’t get confused and just look for the _options at the end. Click the linkd with _options on the end.

 

Find and click the links that say “Select Data”->”Search”

And then fill out the fields to look like the images and finally click the blue “Select” button.

The theme settings that you want to migrate will have the name of the Theme you are migrating from in it somewhere. In this case I’m trying to migrate from ember-wp. This means I want to select the edit link next to the line that says “theme_mods_ember-wp”. I will take the resulting text area as shown below and copy it safely to a text file on my computer.

 

  • 4. Install the new theme and activate it

This is probably going to make you temporarily lose your customizations. You might want to consider a maintenance mode plugin for hiding your site while you do the upgrade.

When you have installed and activated your new theme you will be able to look in the _options table again and see that there is a new theme_mods_ entry in the _options table. Follow the previous steps in this page above to find them. Then select the edit button next to the one that has your new theme’s name at the end. In this case I’m upgrading my theme from Ember WP to Ember Pro and so I click the edit link next to “theme_mods_ember-pro”. I will take the text from the previous steps and copy the old customization settings into the newer theme_mods_ text area.

 

That’s all.

If the theme Customization panel has options that override yours or the names of the options are different then this just won’t work. There is little doubt that some of the extra theme features will need to be temporarily disabled and some things my need to be turned back on.

Much work and time could be required to make the theme match the old theme.  In my case I had to disable some of the frontpage sections and enable others.

If you really want to be careful and make sure it will work then you would want to entirely clone the site using a subdomain of the site. This way you could entirely make the site in a different place and import the newer settings using the above method or by importing the entire site.

Good luck with your site changes.