With the recent release of the long awaited Sitefinity 4 Beta I decided to see how close it was to working on Azure.
It's been on the feature list for version 4 for some time and although it's not on the list for the Beta I was keen to see how close it was, especially in terms of the DB. I had previously tested the 3.7 version against SQL Azure and found that it didn't adhere to the SQL Azure feature set.
So the first task was to see if the database can be easily moved to SQL Azure. If it can't then there is no point looking at migrating the application itself at this point.
I created a new Sitefinity site using the Project Manager and let it create a new DB on the local instance of SQL 2008.
I decided to use the SQL Azure migration wizard, a free tool available at http://sqlazuremw.codeplex.com/
This great tool allows you to script analyse and apply data to and from Azure.
When you run the tool you are taken through a wizard that generates a script from a datasource that you can then apply to another. Simple, but it also checks that the features of the datasource you are scripting are compatible with the feature set of SQL Azure. Although SQL Azure is essentially a high availability 2008 SQL instance, because of the architecture of the system some features on standard 2008 are not available. For example, different file-groups are not supported, as you have no say in where Azure is storing your data this is an irrelevant feature, it's all taken care of.
I was really impressed that even in the Beta the team at Sitefinity have made the DB 100% compliant with the current Azure SQL feature set.
Another cool feature of this tool is that it also copies the data content of the tables at the same time. It does this by using BCP to insert the data once it has created the table. So it's a tool you can use for deploying Sitefinity projects as well (Needless to say it can also be used for backing up a database from Azure to another location).
Once you have a generated script it's simply a case of pointing the tool to your SQL Azure instance and letting it go. The tool sets out the format of the database name and the user name clearly, remember to trim off the "tcp:" that Azure puts on the connection string, you need that in apps you write but not here.
Also remember to allow the IP address of your machine to access your Azure SQL account in the firewall settings tab of the Azure portal or you obviously won't be able to connect.
Once the tool completes running the script you will have a copy of the Sitefinity database in the cloud.
You can now test this from a local Sitefinity 4 Beta site by simply using the connection string generated by the Azure Portal and copying it into the DataConfig.config file in the project. It won't be very quick as it's going out over the net every time you hit the database but it's good for testing and proof of concept.
In the next post I will show how easily the Sitefinity 4 Beta site can be deployed to a Azure as well.
Here is a basic video of going through the process from start to finish.
2 comments: