Archive for May, 2010

Migrating a WordPress installation from your localhost to a production server (using cpanel)

Say you have locally WP installed under WAMP or MAMP or whatever under;


and you want to run it, with all content and plugins and what have not under:

The steps to do this:

– create in your WHM system ( or make sure your site exists
– go to your local phpmyadmin, usually; http://localhost:8888/ and then clicking on phpmyadmin
– click on the database you are using
– click on export
– make sure SQL is selecting on the left
– click on go
– open another tab in your browser and open
– login
– create a database and a user for that database and remember what you you used there
– now open phpmyadmin in your cpanel
– click on the database you just created
– click on SQL
– copy/paste the sql from your localhost tab into this new db and click go
– now connect (with ftp) to your server and copy over everything in your root directory from your localhost (for instance; htdocs/somesite/*)
– edit, remotely, your public_html/wp-config.php; change the values DB_NAME, DB_USER, DB_PASS to the values you used to create your db in cpanel
– now, basically, your site should work; simply try
– if you get a database error, please check your remote wp-config.php to see what went wrong
– you probably now get some error; not found or something like that; this is because the php options are wrong
– to fix this, just open SSH to your remote server and run;

cd /home/somesite
mysqldump YOURDBNAME wp_options > tmp.sql
sed -i ‘s/localhost:8888/somesite/’ tmp.sql
mysql YOURDBNAME < tmp.sql Now your site will work. Have fun.