Possible Duplicate:
Easily Move a WordPress Install from Development to Production?

So I’ve been working with WordPress for a while now and I usually develop locally and then upload everything to my Prod server… however, I’ve experienced a lot of differing results, especially when using plugins.

I usually export the database, but things like the location of the domain don’t always seem to get changed even after changing them within the WP admin beforehand.

What’s the best way to move from Dev to Prod and keeping everything intact?

Then, what’s the best way to move your site from a subdirectory on the same domain?

Please don’t point me in the direction of the WP docs… it’s the first place I looked.

6 Answers
6

Any difference between dev and prod is bad. Here is what I do:

  • Have a different ip for dev server (Whether internal, external, or on local computer is unimportant) — but dev server must be the exact same setup (see bottom paragraph)
  • Change the hosts file (see here) (on yours or a testing computer or a virtual machine) to point to dev server ip
  • Result: HTTP requests sent to dev server have Host header field set as “example.com” exactly like it will be for the prod server.

This method removes two differences often encountered otherwise:

  1. having to change domain name
  2. having dev code in a subdirectory, but prod code in root or diff subdirectory. This is because I use git to transfer files between dev and prod.

.

.

The dev server is set up exactly the same as the prod server (see Chef or Puppet for how to programmatically manage servers).

Leave a Reply

Your email address will not be published. Required fields are marked *