Migrating My WordPress Blog to Windows and SQL Server

I recently wrote an article over at http://wordpress.visitmix.com about my experience migrating my blog over to WordPress on Windows and SQL Server which went pretty smoothly. 


In the next couple of days I’ll go ahead and switch the DNS to my new server at Discount ASP.

Although I’ve been running web site and apps on LAMP since the late 90’s, I’ve really been enjoying PHP on Windows and SQL Server for a number of reasons.

  1. I can develop and test on my own Windows 7 machine or Virtual Machines using SQL Server Express R2 which is FREE.
  2. IIS is really easy to administer.
  3. The Web Platform Installer makes getting up and running simple.
  4. Connecting to SQL Server on my host via SQL Server Management Studio makes developing and managing my database really productive.
  5. Advanced SQL Server features like Spatial and Reporting Services give me a platform for building even more powerful apps.

Some of the things I really like about running on LAMP and miss on Windows include.

  1. SSH access for moving files.
  2. Wealth of information online related to issues when working with LAMP.

There are some tradeoffs but I’ve found the benefits outweigh the downside.  I’ve worked at Microsoft for three years without switching my site so it’s not just because they pay me although it does help :)  All in all, this has been a really good experience and I’d encourage you to give it a try.

Win $10k for Building a Rad PHP App on SQL Server or SQL Azure

Whether you have an established business or have a great startup idea this is an awesome opportunity to win some cash.  The SQL Server team is running a contest for PHP developers building apps on top of SQL Server or SQL Azure with a $10,000 prize.  This includes sites built on top of WordPress or Drupal.


I’ve actually been working with WordPress on SQL and SQL Azure a lot lately and wrote an article about this contest at http://wordpress.visitmix.com which has a bunch of details of how everything works along with some ideas for building the winning app.

Good luck!

PHP on Windows Training Kit Support for Windows 7 Released

Today we published the March 2010 release of the PHP on Windows Training Kit which fixes a bug in the Dependency Checker for Windows 7. 

I apologize to anyone who tried early versions of the training kit and got the following error message.

Your current OS is not supported by the PHP on Windows Training Kit.  This kit takes advantage of IIS7 new features and will run only on those OS that support IIS7.

If your a PHP developer I’d highly recommend taking a look at this training kit.  There are bunch of really cool demos and hands on labs covering the following topics.

PHP & SQL Server Demos

  • Integrating SQL Server Geo-Spatial with PHP
  • SQL Server Reporting Services and PHP

PHP & SQL Server Hands On Labs

  • Introduction to Using SQL Server with PHP
  • Using Full Text Search over Office Documents in PHP

PHP on Windows Hands On Labs

  • IIS Access Control Features for PHP
  • Using IIS 7.0 Media Features in a PHP Application
  • Troubleshooting PHP
  • Migrating PHP Applications to IIS 7.0

You can download the latest version from the Download Center.

Connecting to SQL Azure with SQL Server 2008 R2 Tools

Back in October I wrote a post on how to connect to SQL Azure.  With the release of the November CTP of SQL Server 2008 R2 working with SQL Azure from within SQL Server Management Studio (SSMS) got a whole lot better! 

You can get a free copy of SSMS here:

Because this is a CTP you may want to install these in a Virtual PC although I haven’t had any issues.

Once you have this installed all of the issues I outlined in my previous post about the headaches involved with connecting to SQL Azure are gone.

When you launch SSMS enter your credentials.


Replace MY_SERVER_NAME and MY_USER_NAME with valid credentials which you can setup and find on the SQL Azure portal.

Make sure you have added your IP address to the SQL Azure firewall or you will get the following error.

TITLE: Connect to Server

Cannot connect to ‘<MY_SERVER_NAME>.database.windows.net.


Cannot open server ‘<MY_SERVER_NAME>requested by the login. Client with IP address ‘<MY_IP_ADDRESS>’ is not allowed to access the server.  To enable access, use the SQL Azure Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect.
Login failed for user ‘<MY_USERNAME>’. (Microsoft SQL Server, Error: 40615)

The New Firewall Feature section of a previous post outlines configuring your firewall.

Assuming your credentials are correct you should see Object Explorer just like you would any other SQL Server database, which is awesome!


Once you start using the tool you will notice that things are not as integrated as they are for SQL Server.  For example, let’s create a database.

When I Right Click on Database and select New Database…  a new SQL script is created.


I can simply replace everything between <> and execute the script.


You’ll notice that once I refreshed the Object Explorer I see this new database.  Additionally, you may notice that I specified that I wanted a 10GB database with the MAXSIZE = 10GB option.  If you are just building a sample you should probably leave the MAXSIZE option off and it will default to 1GB.

To round out the example I’m going to install the Adventure Works SQL Azure database following the instructions that come with the sample.

Now when I look at Object Explorer you can see I have the full set of Tables, Stored Procs, etc.


One thing you may notice is that the Adventure Works installer creates new databases AdventureWorksDWAZ2008R2 and AdventureWorksLTAZ2008R2.  Since SQL Azure is priced per database I’ve created a request on the CodePlex site to allow them to be installed into a target database.  If you agree that it’s a good idea please vote for the item on CodePlex.

Hopefully you found this useful.  Please let me know if you have any questions.

More Information

There’s a New Microsoft PHP Guy on the Block!

You may have already run into him but I’d highly recommend following Brian Swan’s work.  He’s got a deep background working with SQL Server and is focusing a lot of his energy making sure the PHP community is successful using Microsoft technology, especially SQL Server and SQL Azure.

He’s already written some good technical articles:

Make sure to add his blog to your favorite RSS reader and follow him on Twitter.