A quick guide to help you develop your ‘online site’ offline. Requirements:
- An offsite test server, preferably running Debian Stable (formerly ‘Sarge’).
- A good knowledge of MySQL, PHP and Bash
- Shell access to your online site.
Proceed with the following steps:
- Create a tarfile that contains all the files on your server, including graphics, themes and that.
- Create a mysql dump of the WordPress database that holds your blog data.
- Copy these back to your local server (scp/ftp)
- Create the same user/password/database on your local MySQL server. Check your wp-config.php file.
- Untar the backup file. Use the same base directory, if possible. If your blog was at /arthur, you may just as well add a new directory /arthur in your local webserver’s document root.
- Untar the SQL backup file. Import this in the database you created before. Grant access to the database for the newly created user. Warning: you may end up editing the SQL dump if you work on two different versions of MySQL. Additionally, using PhpMyAdmin for making dumps will generally not work thanks to the ‘magic quotes’ problem. And hey, since you’re a professional, you may just as well bite the bullet and work on your commandline skills.
- You need to change a couple of WP options in your local WordPress database: most likely:
Choose the IP address of your liking.
UPDATE wp_options SET
option_value= 'http://192.168.1.20/dude/wordpress'
where option_name='siteurl';
UPDATE wp_options SET
option_value= '/var/www/dude/wordpress/wp-content'
where option_name='fileupload_realpath';
UPDATE wp_options SET
option_value= 'http://192.168.1.20/dude/wordpress/wp-content'
WHERE option_name='fileupload_url';
UPDATE wp_options SET
option_value= 'http://192.168.1.20/dude'
where option_name='home';
- Consider upgrading to the latest WordPress version. Since you’re local copy is almost working, do so.
- Consider install PHPXRef.
- Point the database server to the local server in the wp-config.php file. Don’t forget this.
- Log in to your local WordPress using the right user/password. Test the configuration.
- Set!