• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

WP Development Environment Question

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?
  • 6
  • 6
  • 3
  • +1
2 Solutions
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!
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.


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

        <?php wp_theme_switcher('dropdown'); ?>

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.
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.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

tekgrlAuthor Commented:
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?
tekgrlAuthor Commented:
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?
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.

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

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.
tekgrlAuthor Commented:
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?
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.

tekgrlAuthor Commented:
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.
Ok, I'm a little unclear about the changes you are making.
But I'm going to explain with a couple of 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.
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).
tekgrlAuthor Commented:
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?
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.
tekgrlAuthor Commented:
Jason C. LevineNo oneCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 6
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now