PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

RuslanY.net running on Windows Azure Web Sites

Note: This article was originally published at Planet PHP on 23 October 2012.
Planet PHP

I have not been writing any blog posts for a while. That was because for the past two years I have been busy working in a team that develops the Windows Azure Web Sites - a scalable web hosting platform in Windows Azure.

Now that the Windows Azure Web Sites (WAWS) is publicly available I decided to try to move my site from private hosting Ato Windows Azure. My site uses WordPress (with MySql database), PHP 5.3, WinCache object and user cache, URL rewriting and many WordPress plugins. With all these different technologies (many of which are not developed by Microsoft), I thought it would be a good test of how WAWS is capable of running web sites that use open source technologies. Plus I expect that my site will be more reliable and available, comparing to my previous private hosting.

I was pleasantly surprised that the migration from private hosting to WAWS hosting was relatively quick and simple. The site has been running successfully in a Shared compute mode for a while now and none of the site's functionality has been lost or altered. In this post I'll explain the steps I took to move my site to WAWS hosting. Hopefully it will be useful to those who are planning to migrate their WordPress based site to WAWS.

1. Signing up and creating an empty site

The sign up process is straightforward and quick. If you have not signed up before then you can get a 90-days free trial, where you can try all the WAWS hosting options for free. Once you complete the sign up process you will end up at the Windows Azure Management Portal and start creating sites. In my case I started by creating an empty free web site http://ruslany.azurewebsites.net. It takes only a few seconds to create a new site.

2. Creating a MySql database

WAWS works in partnership with ClearDb to provide MySql databases. If you have a relatively small web application with light traffic then the free MySql database provided in Windows Azure should be enough for you. You can create the database by going to the Linked Resources pageA and adding a new Linked Resource:

My site's database was bigger than 20 Mb in size, so I had to purchase the Venus Service Plan on the ClearDB site.

3. Importing data to a MySql database

WAWS provides a web management interface for SQL Azure databases. But not for MySql databases. That was not a problem however, because there is a well known web application for administering MySql - phpMyAdmin. To import the content of my blog I created a new site under my subscription (10 free sites are allowed per subscription) and installed phpMyAdmin there. phpMyAdmin provides a simple way of importing MySql content into a database:

Unfortunately, phpMyAdmin is not yet available in the Windows Azure Web Application Gallery, so I had to install it manually by following the quick install guide.

Important thing to note about importing data using phpMyAdmin. Import requires uploading a sql file to the server. If the sql file is big, you may run into the PHP limit for maximum allowed size of uploaded file. It is possible to increase the limit by following instructions at Configuring PHP in Windows Azure Websites with .user.ini Files.

4. Point WordPress to new database

Once database import is complete, it is necessary to reconfigure WordPress to use new database. The configuration is stored in wp-config.php f

Truncated by Planet PHP, read more at the original (another 3463 bytes)