Solved

WP Development Environment Question

Posted on 2011-03-09
17
252 Views
Last Modified: 2012-08-13
My client has a current WordPress site, and I am developing a new custom-themed WP site. My question is how (and where) do I develop the site so that it is seamless to the users. i.e. They see the current site until I go live with the new one, but still keeping the database info current on my dev site. Does that make sense?
0
Comment
Question by:tekgrl
  • 6
  • 6
  • 3
  • +1
17 Comments
 
LVL 1

Accepted Solution

by:
m1m1k earned 250 total points
ID: 35089499
I think you have a couple of options, depending on your resources.

Option 1:
If you have your own website or a hosting plan that runs PHP, then you can download and install Wordpress on your own site  (I suggest this if you might be doing more WP-themes in the future)
If you don't have your own site (hosting) yet, there are a ton of options to explore: http://x.co/TuPI
If you're just doing Wordpress, all you need is PHP/unix which are usually the cheaper plans.
don't pay any more than 7 or 8 bucks a month.
For more information on that, try: http://codex.wordpress.org/Installing_WordPress

Option 2:
If this is a one-time deal and you don't have access to any servers, then you might also ask the client if a second wordpress theme is available to test with, or if they could set one up for you.
I worked with a client on a job last year where they set up the subdomain http://dev.site.com
which pointed to a different wordpress install then the normal http://site.com for testing.
(if your client is medium to large business then they likely have the resources to be able to help you out with this)

Option 3:
The worst option would be just uploading and installing it on the current live site, and trying to modify it live.  I've done this before with super small businesses and/or one person blogs, but generally errors pop up and you should only do this if you have no other options.  You might try telling the client that this option is what you will be forced to do if they don't set one up for you.


Once you have a working 2nd Wordpress, you can import the data, and upload the theme:

How to move the data to a testing/development server:
Wordpress has a really easy to use import/export function for the data (all posts, comments, etc).

Under "Tools" in the dashboard on the live site, click "Export" -> (All content) -> and then
Download Export File.

Use "Tools" -> Import on your own development copy of the blog to pull in the data after you exported it.  
Then just change the theme on your dev copy to your new theme, and everything will be fully clickable and functional, while keeping the old version untouched on the live box.

hope this helps!
0
 
LVL 31

Assisted Solution

by:gwkg
gwkg earned 250 total points
ID: 35089646
I use xampp to work on a site on my local machine (localhost) and then upload the theme when it's finished.

If you wanted to use the remote database you would put the database address in the config file instead of localhost.  You would need to change the permissions on the remote database to allow remote connections from your ip address.  But is it really necessary to see up to the minute updates of posts and pages while you work on the site?  You can easily export/import posts when you need to.

Another option might be to use this plugin that allows your visitors to choose themes.

http://plugins.trac.wordpress.org/wiki/ThemeSwitcher

You put this in the template to create a drop down list

 <li>Themes:
        <?php wp_theme_switcher('dropdown'); ?>
  </li>

Just wrap that in an if statement that checks for the ip of the machine you are working from.  Then only you will see it and be able to change to your dev theme.
0
 
LVL 1

Expert Comment

by:m1m1k
ID: 35089758
Yes, qwkq is right,

several solutions exist to run php from your local computer.
These might be more technically intense for setup, but it's nice that they don't cost any money.
All depends which is bigger, your pocketbook or your patience.

Here's a couple of links for getting you started running php on your local box, if that's what you decide.
http://www.easyphp.org/
http://developer.apple.com/internet/opensource/php.html
0
 

Author Comment

by:tekgrl
ID: 35090395
Wow. This is a lot of information to digest. I have some follow-up information and questions.

1) I do have my own development server (separate from my client) which I can use to develop

2) My client will continue to be making posts to her current site while I'm developing, so I'm I'm interested to learn more about importing those posts when it's time to go live. My biggest fear is losing any of her new content in the dev process.

3) gwkg -- I'm very interested in this ThemeSwitcher solution. It sounds a little scary though. Is the option to switch themes only available to the admin? I don't want Joe Shmo web user choosing which theme they view the site in... I'm assuming that's where the if statement comes into it? Since I have a dev server, I should have a static IP to assign to this if statement, right?
0
 

Author Comment

by:tekgrl
ID: 35090452
Sorry. Wait. On the third item regarding the if statement and the static IP... Realizing now that my server has nothing to do with it. If I don't have static IP from my computer, the if statement thing won't work, right?
0
 
LVL 31

Expert Comment

by:gwkg
ID: 35095981
If you don't have a static ip, you would need to change the if statement each time your ip changed.

http://myipaddress.com to check your ip or add echo $_SERVER['REMOTE_ADDR']; to a php file and open the file in your browser.

<?php
   $myip = "200.12.3.34"; // put your ip here
   $userip = $_SERVER['REMOTE_ADDR'];
   if($myip == $userip) : ?>
 <li>Themes:
        <?php wp_theme_switcher('dropdown'); ?>
  </li>
<?php endif; ?>

0
 
LVL 31

Expert Comment

by:gwkg
ID: 35096042
Import and Export posts in the admin under tools.

You won't need to do that when you go live though because all you will be doing is activating your theme on her live site.  There won't be anything to import, all her content will already be there.  All that your new theme changes is how the content is displayed.
0
 

Author Comment

by:tekgrl
ID: 35096725
I'm thinking I'm not going to go with the ThemeSwitcher. If I develop on my own server before posting live to my client's server I'll need to import her latest posts into my database, right?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:m1m1k
ID: 35096952
qwkq is right again,
if you can follow his code, then his suggestion will work.
but from what you've said, I'm guessing that you're a very talented designer,
but not a programmer... am I right?
Designers are a blessing, and we couldn't live without you!

My suggestion is this:
install Wordpress on your dev server. http://codex.wordpress.org/Installing_WordPress
export and import the data from the live server.
Then, when you are finished developing your theme, you will have a version of the data that is a few days old (may not have the most recent posts).
I guess the question is: is it absolutely imperative that the client see the theme in the latest posts?  I'm assuming that they just want to see their blog content in the new design, but that you won't have to have it exactly updated.  However, the import and export is easy enough that you really could do another import-export perhaps the day before you showcase the theme.

In any case, once you have the client sign-off on the beautifully designed theme,
simply copy the theme to the live site under /wp-content/themes/

and follow the instructions below to change the live site over to the new theme and viola - all the newest data is all there, along with your new theme.

Here's a couple of links that take you through how to install a wordpress theme,
once you've created it.
http://www.free-themes.org/installing-themes/installing-a-wordpress-theme
http://www.themelab.com/2008/03/02/how-to-install-a-wordpress-theme/


0
 

Author Comment

by:tekgrl
ID: 35117003
You got it, designer making a custom theme. The thing is that only her blog is WordPress now. The rest of her site is static and I'm also adding a bunch of new content.

The way I see it is that if I import/export her database and make all of my updates won't I lose all of my NEW database info on the final import/export? I really just want to import her handful of latest posts. Is that possible? Worst case scenario is adding her new posts by hand to my database before final import, but that sounds LAME.
0
 
LVL 1

Expert Comment

by:m1m1k
ID: 35120117
Ok, I'm a little unclear about the changes you are making.
But I'm going to explain with a couple of assumptions.

Assumptions:
Client's Live Server : lets call it Server "A"
Your dev server : Server "B"
I'm assuming that you are making a custom wordpress theme,
but NOT adding any content (new posts etc) to the Wordpress database.
The way themes *should* work is that they don't touch the data at all.
Since they're completely separate from the data, it means you can swap them out painlessly, without effecting the underlying data.

However, if you ARE planning on adding data content (posts, pages?) in various ways, then my assumptions are wrong, and the subsequent directions will also be wrong.

Based on my assumptions, here's again what I suggest.
For some of the steps check earlier posts for links to help you.

1.  copy her .html files to your dev server (Server A->ServerB)
(including all files in Wordpress directory AND all other files). must have file access to do this (ftp?)
2.  if the copied wordpress blog doesn't function where its at, then you'll have to either try to fix it by messing with the wp-config.php file under the blog folder, OR just install a new wordpress in a different folder, then import the data from the live blog from Server A --> Server B
3.  once you are able to see the pages on dev site, work on the dev copies of everything.
4.  show the client the dev version of the site, get the client to happily sign off on everything
5.  back-up live site, just in case everything breaks on the next step
5.  copy all static files to live site (Server B->Server A)
since you are just copying theme or template files, the database is never changed on the live site, so all of client's data is still there, untouched.  This includes any new posts client made while you were developing the wp theme.

Please let me know if this doesn't make sense, or if I'm not understanding your question.
0
 
LVL 1

Expert Comment

by:m1m1k
ID: 35120127
ok, I re-read your last post,

  "The rest of her site is static and I'm also adding a bunch of new content. "

is the new content inside the Wordpress blog?
Is the end goal that everything WILL be inside the wordpress as pages?
or is the added content just in the static pages?

if you're adding content to the wordpress blog, like new pages, new posts etc, then the above directions are still valid, but on the last step after copying the files, you'd also copy the database (export from Server B, import on Server A).
0
 

Author Comment

by:tekgrl
ID: 35121526
Yes, I will be creating new pages, posts, widgets, etc. on Server B. When I do the final export won't I erase any new posts my client has made on Server A since the original import/export?
0
 
LVL 1

Expert Comment

by:m1m1k
ID: 35140644
Hi Tekgrl,

I did some research, and it appears that doing an "import" only adds in content, and doesn't delete or replace old content.

With this in mind,
I suggest that you leave your new Wordpress installation (server B) fairly empty without importing from the live DB.  After you have added your additional items and made changes, you can then export from Server B -> and import in Server A.  This will add in ONLY the content added in Server B.
So as long as you don't import from the live server first, then you shouldn't have double copies of anything.

However, it is always always advised that you should back up your live database first before importing anything into it, just in case there is a problem.
0
 

Author Comment

by:tekgrl
ID: 35141976
Thanks.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 36508834
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

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 …
Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

746 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