Apostolos Dountsis

Web Development & Desktop Application Solutions
  • rss
  • Home
  • Projects
    • Easy Peasy Image Gallery
    • Social Bookmarks Plugin for WordPress
    • Move Comments
  • Downloads
  • Freelance Services
  • Photo Gallery
    • U2 - Vertigo Tour (Rome, Italy)
    • Brighton
    • Amsterdam
    • Athens 2004
  • Links
  • About
    • Portfolio
  • Contact

Setup a Development Environment for Your WordPress Site

How many times you have stumbled upon a theme or a plug-in that you want to test on your site? WordPress does not offer a preview feature so the only option is to make it live which should not be the prefered (and only) option while testing or in general experimenting with new features.

In this article, we will investigate how we can setup a copy of our WordPress powered site on a local machine will serve as a development and test environment.

Prerequisites

The following tools are needed:

  • WordPress Backup Plugin (included by deafault as part of WordPress)
  • XAMPP (if you are using Windows) or MAMP (if you are using OS X)
  • phpMyAdmin (included in XAMPP and MAMP)

Step 1 - Backup your site

I am certain that everyone is backing their site every week so it is safe to assume that you do not need any instructions on how to do a full backup…. just kidding! Backing up any WordPress site is a two step process.

The first step involves backing up the database that WordPress uses and the second step involves backing up the WordPress core files, your themes and plugins from the remote server.

Database Backup

WordPress includes a plugin for automating the process of backing up the MySQL database. The plugin can be accessed from the admin section (Dashboard), under Manage > Backup. The plugin automatically selects the core tables but since third-party plugins may use extra tables, a list is displayed on the right-hand side where you can select additional tables. As a rule of thumb, any table with the wordpress prefix (default value ‘WP_’) should be selected.

Select whether you want to email the backup to yourself or download it directly to your local machine and press the Backup! button. When the operation is finished you have made a backup of the WordPress database.

WordPress Files Backup

In order to backup the files, you need to use an FTP application like WinSCP if you are running Windows or CyberDuck if you are running Mac OS X.

Start your FTP application and connect to your WordPress server. Navigate to the wp-contents directory of your remote server and download all the files and directories it contains to your local computer.

Step 2- Install local web server

You need to install a web server on your local computer. The easiest approach is to download and install an Apache web server containing MySQL, PHP. XAMPP is the best product to use if you are running Microsoft Windows. If you are running Mac OS X then MAMP is your friend. Both of them are really very easy to install and to use - just download, extract and start.

Note that both of them create a root account for MySQL with blank password or with the word “root”. It is highly recommended to change the password to something else and use that password when installing WordPress.

phpMyAdmin is also installed as part of XAMPP and MAMP. 99.99% of the times, it resides on the phpmyadmin directory (or an alias is in place for this location). Open it up, and create a database for the WordPress development site.

Step 3 - Install WordPress

Download a copy of WordPress from the WP site. Extract it into the httpdocs or www folder of your XAMPP installation. Navigate to that directory through your browser and complete the WordPress installation process.

Step 4 - Import your Settings

Our first step was to backup the WP database. We will now use the produced MySQL script to populate the backup WP system with our site settings.

Open the MySQL backup script with your favourite text editor, and search for the term ‘wp_options’. That’s the table that holds your settings. We need to remove the ’siteurl’ entry since it is now different on the local server (and the correct entry for ’siteurl’ was created during the WordPress installation for us). So, delete the line that reads something like:

INSERT INTO `wp_options` VALUES (1, 0, 'siteurl', 'Y', 1, 'http://www.dountsis.com', 20, 8, 'WordPress web address', 1, 'yes') ;

Save the changes and close the file. Navigate to phpMyAdmin and select the database where you have installed the development WP site. Execute the database backup script to import the dev system with your content and settings.

Finally, copy the local copy of the WordPress Files backup (themes and plugins) that was created during the 1st step to the equivalent location of the development site.

The development/test environment should now be an identical copy of the live site where you can test new themes and/or plugins or develop your own.

[ratings]

Bookmark This Page

Add to BlinkBits Add to BlinkList Add to Bloglines Add to Blogmarks Add to Blogmemes Add to Blue Dot Add to Co.mments Add to Del.icio.us Add to De.lirio.us Add to Diigo Add to digg Add to DZone Add to Facebook Add to Fark Add to Feed Me Links Add to Fleck Add to FriendSite
Add to FURL Add to Google Bookmarks Add to Kaboodle Add to Ma.gnolia Add to Mister Wong Add to Netscape Add to Netvouz Add to Newsvine Add to PlugIM Add to PopCurrent Add to reddit Add to Slashdot Add to Stumble Upon Add to Shoutwire Add to SphereIt Add to Taggly Add to Yahoo My Web
Hide Sites
Categories
PHP, Programming, WordPress
Comments rss
Comments rss
Trackback
Trackback

« Automatic Restarting in XP The Hitchhiker’s Guide to the Galaxy 20th Anniversary Edition From The BBC »

3 responses

[...] post es una traducción del original obra de [...]

Tranpalitu » Blog Archive » Configurar un entorno de desarrollo para tu sitio WordPress | December 17, 2007

[...] post es una traducción del original obra de [...]

Cheers for that!!

Nick | December 27, 2007

Cheers for that!!

Excellent post, i use same way in my theme production

Sven | March 17, 2008

Excellent post, i use same way in my theme production environment

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Categories

  • Adventure Games (1)
  • EPIG (3)
  • Firefox (6)
  • Funny (2)
  • General (11)
  • Microsoft (3)
  • PHP (9)
  • Programming (6)
  • Windows (4)
  • WordPress (16)

RSS Feeds

Subscribe to the Articles RSS feed Subscribe to the Comments RSS feed

Keywords

adblock adventure adventure game Bad Sectors BBC chkdsk Del.icio.us extension Firefox Flash Game Hard Disk Microsoft PEAR PHP Windows Windows XP WordPress

Recent Posts

  • Del.icio.us Firefox 3 Extension
  • Site Revamp & WordPress 2.5
  • Social Bookmarks 4 Point Release
  • Firefox 3 Beta 4
  • The Hitchhiker’s Guide to the Galaxy 20th Anniversary Edition From The BBC
  • Setup a Development Environment for Your WordPress Site

Spam Blocked

60,375 spam comments
blocked by
Akismet
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox

© 2006 - 2008 Apostolos Dountsis - All Rights Reserved