简体   繁体   English

从SQLCE 4迁移到SQL Server 2008

[英]Migrate from SQLCE 4 to SQL Server 2008

So, being an early adopter, I have developed an application based on SQLCE4, ASP.Net MVC3 and Entity Framework CTP5 (code first) based on a fit of recklessness induced by reading this announcement . 因此,作为早期采用者,我基于阅读此公告引起的鲁莽行为,开发了基于SQLCE4,ASP.Net MVC3和实体框架CTP5 (代码优先)的应用程序。

Now the application is moving into production and we need to lose the ce in favour of SQL Server 2008 and later azure. 现在应用程序正在投入生产,我们需要失去ce,转而支持SQL Server 2008和更高版本的azure。

Scott Gu mentioned that tooling would be out soon to support such migrations but I wonder if we're too early to take advantage of an easy route. Scott Gu提到工具很快就会支持这种迁移,但我想知道我们是否为时尚早,无法利用一条简单的路线。

Anyone done it? 有人做过吗? Is there a simple migration path? 是否有简单的迁移路径? Something like the MDF create script option in Visual Studio? 像Visual Studio中的MDF创建脚本选项?

Have you looked at SQL Server Compact Toolbox and SQL Compact data and schema script utility on codeplex? 您是否在codeplex上查看过SQL Server Compact ToolboxSQL Compact数据以及架构脚本实用程序

It allows you to script schema and data to a .sql file, which can be used in any context. 它允许您将模式和数据脚本编写为.sql文件,该文件可以在任何上下文中使用。 It also scripts DML for use in SSMS scripts. 它还编写DML脚本以用于SSMS脚本。

You can use the resulting script for documentation, programmatic scripting of SQL Compact database files, or migration of schema and data to SQL Server (Express) 2005 or later 您可以将生成的脚本用于文档,SQL Compact数据库文件的编程脚本,或将架构和数据迁移到SQL Server(Express)2005或更高版本

You can do so using Webmatrix too 你也可以使用Webmatrix这样做

Here's a good explanation: http://www.sarasota.me/blog/migrate-orchard-database-sql-server-ce-to-sql-server-webmatrix 这是一个很好的解释: http//www.sarasota.me/blog/migrate-orchard-database-sql-server-ce-to-sql-server-webmatrix

I've followed the instructions from this blog post by ErikEJ and the migration was simple and successfull using only three steps: 我按照ErikEJ的博客文章的说明进行操作,只使用三个步骤,迁移很简单,成功:

  1. ExportSQLCE.exe "Data Source=D:\\Orchard.sdf;" OrchardSqlCe.sql
  2. sqlcmd.exe -S .\\SQLEXPRESS -Q "CREATE DATABASE Orchard"
  3. sqlcmd.exe -S .\\SQLEXPRESS –d Orchard -i OrchardSqlCe.sql

ExportSqlCe is a tool written by the same ErikEJ which exports both schema and data to a text file. ExportSqlCe是由同一个ErikEJ编写的工具,它将模式和数据导出到文本文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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