Dev and Live version of a WordPress site

1 08 2008

Setting up the DEV and LIVE sites

Download the wordpress installation:  http://wordpress.org/download/.

In the dev and live servers, create a new empty folder in your websites roots.

Unzip the wordpress installation and copy the files in the newly created folders.

Set up the Apache’s virtual host for your dev and remote sites.

Create a new empty database i.e. culturegeeks in the dev server and another with the same name in your remote server.

Rename wp-example.php in wp-config.php.

Open wp-config.php and set the database settings so that if you are in your dev server you will connect to the dev database, otherwise it will connect to the remote database. In my case that’s what I got:

switch($_SERVER['SERVER_NAME']){
 case '192.168.0.2':
 //dev site (fileserver)
 define('DB_USER', 'I am not gonna publish it here!');     // Your MySQL username
 define('DB_PASSWORD', 'I am not gonna publish it here!'); // ...and password
 define('DB_HOST', '192.168.0.2');    // 99% chance you won't need to change this value
 break;
 default:
 //live site (dl320) //remote user:admin pwd:*g11eiKu9Y#E
 define('DB_USER', 'I am not gonna publish it here!');     // Your MySQL username
 define('DB_PASSWORD', 'I am not gonna publish it here!'); // ...and password
 define('DB_HOST', '212.42.165.194');    // 99% chance you won't need to change this value
 break;
}
define('DB_NAME', 'culturegeeks');    // The name of the database

Go to your dev website address and run the installation script:
devyourwebsite/wp-admin/wp-install.php

This will set up the dev website.

Go to your live website address and run the installation script:
devyourwebsite/wp-admin/wp-install.php

This will set up the live website.

You will be asked to give your blog a title and an email address. Next, you will be prompted with a username and password. Save these details, as you’ll require them when you access the website’s dashboard (admin area).

Set up the new site in Dreamweaver, where the local settings refer to the dev site and the remote settings your remote site’s ftp details. Test the connection is successful.

The two sites have now been initialized and should be exactly the same.

Update your remote site

Let’s say we want to make some changes to the look&feel of the website. First, we will apply a new template to the dev site, twick it and then upload the changes to the live site.

First, download the new template. A range of free templates can be found at: WordPress Theme Viewer

Unzip the package i.e. dummy_Theme into the themes/ folder of your dev site. 

Go to your dev site’s dashboard, the new theme should appear as one of the available templates.

Make changes, i.e. change the logo (which can be found in the images/ folder of the theme).

In Dreamweaver, right-click on your chosen theme, theme/dummy_Theme  and click Put. This will automatically upload the folder in your live site.

Go to your remote site’s dashboard, the new theme should appear as one of the available templates.

References

http://codex.wordpress.org/Main_Page - wordpress guide

http://codex.wordpress.org/Installing_WordPress#Detailed_Instructions - detailed installation’s instructions


Actions

Information

3 responses

3 08 2008
Dreamweaver

Another very useful tool for tweaking WordPress themes in Dreamweaver is ThemeDreamer. It creates a complete blog page from all the php includes and you can edit your themes just like any other site in Dreamweaver. It also provides code tags, proper syntax, conditional tags and code hints.

12 08 2008
Alex

I found your site on technorati and read a few of your other posts. Keep up the good work. I just added your RSS feed to my Google News Reader. Looking forward to reading more from you down the road!

14 08 2008
AlexM

Your blog is interesting!

Keep up the good work!

Leave a comment