Transfer a WordPress from development to deployment domain


So, recently I decided to setup a EC2 ubuntu server to get my developer to work on developing my website. While I was setting it up, I realized the need to document the steps involved. As I could not find all in one place. So here goes for all those dudes out there.

On your EC2, create a new Instance and use a Vanilla Ubuntu 10.04 (not 11, its unstable as of now)\

  • sudo apt-get install subversion mysql-server apache2 php5
  • sudo apt-get install php5-mysql

On your EC2, configure Security Groups to allow port 80, for inbound 0.0.0.0, Apply rules

  • sudo service apache2 restart
  • ssh to the ec2
  • On your EC2 prompt>sudo vi /var/www/index.php and insert

<?
phpinfo();
?>

Test your apache2 on the ec2.

  • Open browser on your host machine, enter dns name of the EC2, test for index.html.
  • Now test for php, On the browse dnsname/index.php

On your EC2

  • sudo mkdir checkout
  • sudo svn co <svn path of your project>
  • mv wordpress /var/www
  • mv bugzilla3 /var/www
  • sudo apt-get install perl gcc bugzilla3

Create appropriate databases on your EC2

  • sudo mysql -u root -p
  • mysql>create database bugs ;
  • mysql>create database wordpress ;

From your Host, export bugs, bugzilla3 and wordpress database to .sql files

  • mysqldump –tables -u root -p wordpress >> wordpress.sql
  • mysqldump –tables -u root -p bugs >> bugs.sql
  • mysqldump –tables -u root -p bugzilla3 >> bugzilla3.sql

On your EC2 .import into database sql files (EXCEPT wordpress)

  • sudo mysql -u root -p bugs < bugs.sql
  • sudo mysql -u root -p bugzilla3 < bugzilla3.sq

Now, the most important part, since you are moving the site from localhost to a EC2, wp_options table needs to be modified a bit.

  • vi wordpress.sql and run a :s%/localhost/YOURNEWDNSNAME/g on it to replace all “localhost” instances in the database with your new dns name.
  • I found 13 places. Modify all localhost to your public dns of EC2.
  • now run a “sudo mysql -u root -p wordpress < wordpress.sql

In my case I had used WP_UI tabs plugin, so its settings just died on the new EC2. So I had to enable a few settings.

If you get lost refer to “http://codex.wordpress.org/Moving_WordPress“. This is what I used to get mine up and running.

Advertisements

2 thoughts on “Transfer a WordPress from development to deployment domain

  1. Hi, i feel that i saw you visited my website thus i got here to “return the choose”.I’m attempting to find things to enhance my web site!I suppose its ok to make use of some of your concepts!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s