views:

341

answers:

3

Hi.

I am about to start building a new site in Wordpress on the same domain as the old site. I need the old site to stay live until the new one is launched and I also need to develop online.

What is the best way to go about this? Should I create a subdomain or subfolder?

How would I go about migrating the Wordpress site & database from this testing area to the root on completion?

Thanks.

+1  A: 

This depends on your hosting environment.

If you have a Cpanel hosting account you can create a subdomain through that, which actually creates a subfolder. This is known as a virtual subdomain.

So you can access the test site by going to www.yourdomain.com/subfolder or www.subfolder.yourdomain.com

This is good because it doesn't lock you in either way.

As to migrating your site I would back up your old sites files locally (via FTP) and your database via PHPMYADMIN. Then copy your development site via FTP into the root directory and update your database via PHPMYADMIN

Tim
Perhaps you should have all the site files backed up on your local PC anyway, always. The db can be exported to a file and depending in its size after compression, you could down load it to for safe keeping and disaster recovery. Or migration another hosting site, whatever.
Don
A: 

You may need to change .htaccess, too, unless Cpanel (if used) handles that: Changing The Site URL « WordPress Codex and Moving WordPress « WordPress Codex.

songdogtech
+1  A: 

With WordPress you can create either a sub-domain like http://blog.mysitename.com or a sub-folder like http://mysitename.com/blog/ - either one WordPress will support - you just need to make your settings in your wp_options table (usually rows w/ ID's 1 & 39) point to the appropriate domain you've set up. It just kind of depends on what kind of control you have over your server, but from the sound of it, you should have enough to do both.

For your database - you can actually point to the same database & just pre-pend your table names with some sort of prefix to distinguish between your existing site & your new site. WordPress by default prepends your table names w/ "wp_", so for example "wp_TABLE_NAME" with the all cap's being replaced w/ the actual name of the WordPress table (like your wp_options table). Or, you can set up a entirely new database too & it wont matter.

The key is when the WordPress site is ready to go live, you'll need to point the main domain to the new site & then change the wp_options table to use the new URL.

Tim Schoffelman