[英]Local MDF to SQL Server Application Migration
I am in the process of designing a database application that will ultimately be a multi-user application. 我正在设计一个数据库应用程序,该数据库应用程序最终将是一个多用户应用程序。 However for ease of development purposes I was planning on using the built in local
.MDF
file for Visual Studio for now. 但是,为了便于开发,我现在计划使用Visual Studio的内置本地
.MDF
文件。
Once I am ready to move this into a multi-user environment is it just a matter of moving the .MDF
to the server and attaching it, then changing a connection string? 一旦准备好将其移到多用户环境中,是否只需将
.MDF
移至服务器并附加它,然后更改连接字符串? Or is it going to be a project in of itself and I am better off just using the SQL Server from the beginning? 还是它本身就是一个项目,而从一开始就使用SQL Server更好?
Edit : it would be considerably easier for me to do development from the .MDF
because I do a lot of work from home and that would mean I need to use VPN (Very slow). 编辑 :对我来说,从
.MDF
进行开发会容易.MDF
因为我在家做很多工作,这意味着我需要使用VPN(非常慢)。
Another option I am considering is to use SQL Server Express on my local machine and then migrate that to the production server when I am ready. 我正在考虑的另一种选择是在本地计算机上使用SQL Server Express,然后在准备就绪时将其迁移到生产服务器。
As already said by Erik, you are already using SQL server. 正如Erik所说,您已经在使用SQL Server。
Just so you know, I'm using the .MDF file for development and once the changes are done, I publish them to production. 大家知道,我正在使用.MDF文件进行开发,完成更改后,我会将其发布到生产环境中。
To do this, You need to keep following points in mind. 为此,您需要牢记以下几点。
What I follow is below (All the steps are in Visual Studio 2015 Update 3 ): 下面是我遵循的内容(所有步骤都在Visual Studio 2015 Update 3中 ):
All the schema differences will be listed in the area below the toolbar. 所有架构差异将在工具栏下方的区域中列出。
The selected changes from your mdf file will be copied to the production database. 从mdf文件中选择的更改将被复制到生产数据库。 In case of any error, the errors will be displayed in the results.
如有任何错误,错误将显示在结果中。
You are already using SQL Server. 您已经在使用SQL Server。 The difference here is whether or not you want to attach it to a JIT SQL Server instance or by connecting directly to a SQL Server instance.
此处的区别在于您是将其附加到JIT SQL Server实例还是直接连接到SQL Server实例。
If you plan to use a real SQL Server instance anyways in the future, it's best to just avoid the App_Data
folder. 如果您打算将来使用真实的SQL Server实例,最好避免使用
App_Data
文件夹。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.