Home Ask Login Register

Developers Planet

Your answer is one click away!

hsimah February 2016

Migrate SQL Server CE to Azure

I have finished my first complete Orchard CMS website, developed locally in SQL Server CE. I want to publish it to Azure, but I am having difficulty with the WebMatrix Migrate function.

I have a SQL Server instance in Azure with an blank Orchard database already there (I want to use the replace option late in the migration to just nuke the existing db). I have added my IP to the server firewall rule.

In WebMatrix 3 I can connect to my Azure database using:

  • Server: myserver.database.windows.net
  • Database: orchard-db
  • Username: admin@myserver
  • Password: mypassword

I can view the tables in WebMatrix.

When I select my CE sdf file (Orchard.sdf) and click the Migrate button and enter the exact same details I get the following (can provide full stack trace if needed):

We were unable to connect using the connection details provided.

Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server . ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception: The network path was not found

I'm really not sure what the issue is. I have tried various configurations of the details but nothing seems to work. If I connect as my database user (i.e. not a server admin) I get a different error:

The server principal "orchard_user" is not able to access the database "master" under the current security context.

I went and had something to eat, and now I can get to the next step of the migration. When I s


hsimah February 2016

I ended up installing SQL Server Express, using WebMatrix to migrate the SQL Server CE database to that. I then ran the Deploy Database to Microsoft Azure Database Wizard in SSMS to push my database to Azure.

I can't be certain, but it seems that WebMatrix can't migrate CE to Azure. According to Azure doco:

It is recommended that you always use the latest version of Management Studio to remain synchronized with updates to Microsoft Azure and SQL Database. Update SQL Server Management Studio.

I guess WebMatrix is behind or something. Hopefully this helps someone in my situation.

Post Status

Asked in February 2016
Viewed 1,652 times
Voted 13
Answered 1 times


Leave an answer

Quote of the day: live life