简体   繁体   中英

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 (ie 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 select replace database I get the following error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server . ---> System.Data.SqlClient.SqlException: Login failed for user 'admin'.

EDIT: I have come to the conclusion WebMatrix is not going to migrate my SQL Server CE database to my Azure SQL Server database. I installed SQL Server Express and migrated it to that, when I get home from work I will use the SQL Server Migration Assistant to move it to Azure.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM