Solved

Best method for changing Wordpress themes?

Posted on 2012-03-25
7
579 Views
Last Modified: 2012-03-25
If you have a Wordpress site up, and it has been in use for 2 years (with the many posts and things that go along with that), what is the best method for installing a new theme, without taking the whole site down?

The thing is, I have a friend with a Wordpress site he has posted to for a couple of years.  It is a pretty involved site.  Now he wants to install a new Wordpress theme.

Wordpress themes (at least the ones I have used) are not simply plug-and-play.  They require lots of tweaking and shortcode manipulation to get the look "just right".

One way is to use a plugin to show a maintenance page to visitors while the tweaks are done to the new theme.  But, this can mean the site is down for a week.

Is there a way to work on a new theme, then "flip the switch" on it when you have it like you want?

I could create a completely new site using test.hisdomain.com, backup the entire site from www.hisdoman.com, install the backup to test.hisdomain.com, change all of the domain name stuff, do the work there, then back everything up from test.hisdomain.com, movve it all back to www.hisdomain.com and change the domain name and related database fields back and cross my fingers that all of this works - but, damn that seems like a lot of work for something that, I assume, people do pretty regularly (change their Wordpress themes).

There has to be a better (easier) way to do this without disrupting the current site.

What am I missing?
0
Comment
Question by:JimHubbard
  • 3
  • 3
7 Comments
 
LVL 18

Accepted Solution

by:
Sudaraka Wijesinghe earned 500 total points
ID: 37763561
As I start to read your (quite long ;) ) description, first suggestion came in to my mind was to tell you to make a backup of the DB and files and create a test site to work on.
But it seems that's the exact thing you are trying to avoid.

So I'm going to suggest this instead. Please note this is not some thing used in practice, I only know it works but don't know if it would be easy.

In the recent version of Wordpress (3 and later I think) there is an option in the theme selection page to preview in the site using a theme other than the one currently activated. If you examine that link, it goes something like this.
http://domain.com/?preview=1&template=twentyeleven&stylesheet=twentyeleven&preview_iframe=1&TB_iframe=true

Open in new window

You can use that to see the site in the theme you want. By default it open in a popup/iframe, but if you copy the link and paste it into a browser you will be able browse normally. (Might help to drop the iframe parameters)
http://domain.com/?preview=1&template=twentyeleven&stylesheet=twentyeleven

Open in new window


Hope this helps.
0
 

Author Closing Comment

by:JimHubbard
ID: 37763595
It did help.  Thanks.

But, I think I've found out why it won't really work (and why I am going to have to go the long way around).

If I change things like the menu, sidebar locations, etc, those changes will show on the current site - even though the theme stays the same.

Not to mention the changes to the admin menus that come with a lot of themes.  The theme-specific menu items on the admin pages only show when a theme is activated.

IMHO, Wordpress really needs to roll in functionality that will duplicate the site (using temp directories in MySQL while leaving the tables used to store uploads, posts and comments alone) and then merge the changes (after making a backup of the old site of course).  The temp directories should show the new site design to logged in users designated by the admin to see the in-progress theme.

So...it looks like I am stuck with copying the entire site, setting up a dummy test domain, blah, blah blah.....

Thanks for your input though.

I think I'll try BackupBuddy.  It looks like it handles the backup and migration.  It should make this whole thing a little easier.

The only possible problem with BackupBuddy will be that any post, comments, uploads or added pages done between the time I copy the original site to m test location and the time I copy the test to the main site will be lost.

Dammit!  With theme changes being such an integral part of Wordpress, you'd think someone would have addressed this by now.

Looks like the site may be down a few days while the new site is built.
0
 
LVL 18

Expert Comment

by:Sudaraka Wijesinghe
ID: 37763636
Since you are creating a test domain anyway, you can clone both files and database to be used in it and work on them leaving the existing site as it is until you are done with the modifications. After you are done with the upgrade you can merge them to the live site.
Few days downtime can really hurt a web site.

Good luck with the upgrade. And thanks for the points.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:JimHubbard
ID: 37763665
The idea of "merging" the sites seems scary.  Some items need to be overwritten, some need to stay (like posts, comments, etc).

So, how would you merge the test and live sites while preserving all changes to the new theme, plugins, sidebars, etc without overwriting the new posts, pages, links in blogroll, changes to content of sidebars etc?

I don't think it's possible.

You'd have to make a copy of the test site database tables and directories before you change anything, make all of your changes to the new site, then do a comparison of the beginning database file and directories to get a list of changes.  Then, you'd have to create a package of changes to import into the live site (both for the database and directories).

In theory, this should not overwrite any comments, posts or pages.  It may overwrite links in blogrolls, themes, images, etc..

The only possible issues would be if Wordpress were updated while the test site was being built on an older version.  Ideally changes on the live site should be frozen (with the exception of posts, pages and comments) while the new site was being built.

That's what I need.

Know a good PHP developer?
0
 
LVL 18

Expert Comment

by:Sudaraka Wijesinghe
ID: 37763704
In Wordpress (and in any CMS for that matter) UI is separated from data and can be modified without effecting any data you have.
You new theme could hide some links or post, but that data is not deleted from the database by switching the theme, in any case you can change it back to the old theme.

However, If you are in doubt of the procedure it would be best to hire a professional to do it for you.
There was an option in EE to search for available experts, I'm not sure if that possible in the new system.
You can post on the Wordpress forums to look for someone, or google for a Wordpress developer.
0
 

Author Comment

by:JimHubbard
ID: 37763712
Ok...here's what I have decided to try.

Make the test domain, copy the existing site there, make my changes and prep it to migrate to the live site.

I'll put the live site in maintenance mode, and do a complete backup and save that somewhere safely off the live site.

Before migrating, go to the Admin menu, Tools>Export, select All Content and do an export.  

It says "All content This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts."  I hope that means that it also keeps attachments, images etc.

I'll use BackupBuddy to migrate the test site to the live site.  Then, I'll import my exported data into the live site and disable maintenance mode.

If all goes as planned, this should do the trick.

I''ll let you know.

My only concern is that I will be creating content while creating the new look (for sliders, landing page, and so on). For example, if I create a cool new Home page, it may be overwritten in the import of the old data (since I had an old Home page in the old site).

Well....I might as well dive in.  As long as I have backups, I should at least be able to get back to square one if the whole thing craps out on me.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37763774
You've pretty much hit on it.  What you describe initially is an ideal but it doesn't exist.  Clone and replace or clone and merge are the only two options at present.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now