WordPress with MS SQL Databases

During the past half decade I’ve deployed my share of WordPress sites. Though my background primarily revolves around Microsoft technologies, many of those deployments were on top of some kind of a Linux distribution due to the nature of WordPress that it was originally optimized for LAMP stack. However, there have been a couple of Windows server based deployments as well with the use of MySQL as the backend.

In recent years, with the popularity of cloud solutions, many people saw the benefit of using their existing cloud solution such as Microsoft Azure, AWS, Google Cloud Platform, etc. to host their web sites. Most of the websites, or blog sites nowadays are developed using WordPress due to the fact that WordPress being free and open source. This makes it easy for you to download, customize and host as you want. In this post, I will be talking about your options when it comes to hosting your WordPress site or the blog in Microsoft Azure by using Azure SQL (PaaS) databases.

Why?

Creating a WordPress site on Azure  only take a few minutes.  Through the Azure marketplace you can easily create and install WordPress with MySQL and, you are done. But, there can be situations where you wouldn’t want to pay for MySQL instance on Azure. Some of the reasons being,

  • You prefer MS SQL as your database engine or you’re more familiar with it.
  • You already are paying for an Azure SQL (PaaS) database instance in Azure and don’t see the need to pay an additional fee for MySQL.
  • You are using a monthly BizPark or MPN or MSDN subscription credits which wouldn’t cover the fees incurred by MySQL instances.

So this brings the question. Can I use WordPress with an MS SQL instance? The short answer is “Yes“.

MS SQL Server or Azure SQL (PaaS) databases can be substituted for a MySQL database. But not without some bridging technology.  There have been some attempts to make this easier over the years, but there is a interesting open source project called Project Nami. It was created to allow WordPress to talk to MS SQL databases natively.

How?

So, how can we deploy this? There are few methods doing this.

  1. Via Project Nami site you can deploy using the Azure Resource Manager model.
  2. Via Project Nami GitHub repository as the deployment source.
  3. Via downloading binaries from Project Nami official site.

You can navigate to http://projectnami.org/download/ to download binaries for manual deployments or to deploy Project Nami binaries directly to Azure in step by step wizard using ARM or view their tutorials on other ways of how to deploy Project Nami to Azure.

A Case Study

An example of a WordPress deployment that’s hosted on Microsoft Azure with an SQL database is this very blog.

Earlier I had hosted this blog on Digital Ocean on LAMP stack in a CentOS VM. For $10 a month, I got 1 vCore, 1GB RAM, 30GB SSD, 2TB traffic for the server. It was a good deal. However,  I entirely was responsible of managing the VPS including but not limited to maintain updates for the OS, managing the MySQL database, firewall configuration, security, etc. This was a headache for me since I didn’t want to put a significant amount of my time on administering a server when I could write articles on that time.

I’ve looked for managed hosting solutions and they were out of my budget. When I got an MSDN subscription as part of my MCT benefits, I realized I could host my blog on Microsoft Azure. With that thought, I looked for solutions to utilize Azure SQL (PaaS) databases. That’s when I stumbled upon Project Nami. After reading about it, I knew this was just what I needed. Last April, I deployed WordPress on Microsoft Azure and I was able to migrate my blog from Digital Ocean to Microsoft Azure very easily. All my plugins, posts, uploads and everything works perfectly as if it was hosted on a LAMP stack.

So, why wait? Try it out today.

2 thoughts on “WordPress with MS SQL Databases

  1. Moran

    Hi, thank you, project nami seems like a good solution.
    however, I cant get data from the db to the wp site(project nami site).
    any idea if plugins are needed?
    thanks

    Reply
    1. Muditha Jayath Chathuranga Post author

      Hey Moran,

      Nothing that I installed specifically for that. However, there were few plugins that came with the package itself. How did you deploy to Azure? Manually by uploading files or via GitHub?

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.