Upgrade Azure Website to v1.7

Topics: Installing Orchard
Jul 19, 2013 at 1:31 AM
I would like to upgrade my current Orchard site (hosted on Azure Websites) from v1.6.1 to v1.7. I am trying to following the instructions at this link, but I'm having some trouble.

Before making the upgrade in production, I wanted to test the migration from 1.6.1 to 1.7 on my local machine. First, I downloaded the entire wwwroot folder from the Azure Websites server so I could run it on my local machine. This folder contains all the Azure.Web contents. Then, I opened the local wwwroot folder in WebMatrix. When I run it, however, I get a 404 error. My Settings.txt file in App_Data points to the production Azure SQL database.

A few questions:
  • Why am I getting a 404?
  • Even though I'm trying to run the site on my local machine, shouldn't it work as long as the Settings.txt file still points to the production database?
  • Will my existing database work without modification in v1.7 or does the database also need to be upgraded?
  • The site upgrade article in the Orchard docs suggests backing up the database before doing an upgrade. Is the .sdf/.mdf file the only one that needs to be backed up?
Jul 19, 2013 at 4:06 PM
Edited Jul 19, 2013 at 4:07 PM
  1. Whenever you get a 404, consult the error log in App_Data. This has usually something to do with a connectionstring not working.
  2. If the production database is reachable from your local, whitelisted by Azure, then yes.
  3. That depends on the 1.7 modules: if they include UpdateFromX migration steps, they will update your schema. It also depends on whether you enable new features: they will update the schema as well.
  4. If you're using SQL CE, backup the .SDF file. If using SQL Azure, SQL Server (Express), use the SQL Server Management Studio tool to backup the database. Simply backup up the MDF file should be enough, but I don't know for a fact since I never did that. To be sure, try it out.
Jul 21, 2013 at 4:33 AM
Edited Jul 21, 2013 at 8:37 PM
Thank you @sfmskywalker. I whitelisted my local IP address on the Azure dashboard, and that took care of the 404 error and I'm able to run my Orchard site from my local machine using the production database.

Now I am having a problem when I try to Migrate Taxonomies using the Upgrade module. The screen shot and log excerpt are below. I don't know how to fix this problem.

2013-07-20 22:20:37,361 [45] Upgrade.Controllers.TaxonomyController - Unexpected error while migrating to Orchard.Taxonomies. Please check the log.
System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Contrib_Taxonomies_TaxonomyPartRecord'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbComm
Jul 21, 2013 at 10:55 AM
The stack trace indicates that there is no table called 'Contrib_Taxonomies_TaxonomyPartRecord'. Your first step would be to verify that this is true.
Jul 21, 2013 at 5:24 PM
This means that you are trying to upgrade to the new Orchard.Taxonomies module but as you don't have the previous one you can skip this step.
Jul 21, 2013 at 5:45 PM
I'm happy to hear that it isn't a meaningful error, but I'd like to understand why the error message popped up in the first place. I had assumed that the upgrade module would a) compare my v1.6.1 instance to the v1.7 instance; b) upgrade modules that I was moving to my v1.7 instance (as necessary); and c) skip modules that I didn't have in my v1.6.1 instance. Was my assumption incorrect?
Jul 21, 2013 at 7:58 PM
Are you still connected to the production SQL server?
be careful so you don't upgrade production while the azure site is still on 1.6
Jul 21, 2013 at 8:07 PM
Sorry, I don't understand. I'm following the instructions at this link. I chose the "Upgrading a Running Instance of Orchard to a New Version" upgrade path. The docs said that it isn't necessary to download a local version of the database.

Also, you warned against upgrading production while the Azure site is still on 1.6. However, the Azure site is the production site.
Jul 21, 2013 at 8:28 PM
You mentioned that you've downloaded the site and that you are running it locally (your post of 6:33AM)
If that is the case, and you have the local site connected to the production database, and the production website as well conected to the production database.

the documentation tells you to copy the database, and then test the upgrade.

I have no idea what happens if you upgrade the production database to 1.7 and still have the azure site at 1.6, that was my question to you.

If you made a backup, or if you are upgrading the azure site, then all is OK.