将远程开发数据库移动到本地使用

时间:2020-12-31 23:31:51

I have been using a central MS SQL database located in the cloud to develop a web site project. I have recently found myself in situations, when I need to develop without the internet connection. I want to begin to use a locally available copy of the existing database, put it in App_Data folder.

我一直在使用位于云中的*MS SQL数据库来开发一个网站项目。我最近发现自己的情况,当我需要在没有互联网连接的情况下开发。我想开始使用现有数据库的本地可用副本,将​​其放在App_Data文件夹中。

What is the correct set of steps I need to undertake to get the project to work with local DB?

为了让项目与本地数据库一起工作,我需要采取哪些正确的步骤?

For example:

  1. Detach a db from an existing SQL instance.
  2. 从现有SQL实例中分离数据库。

  3. Copy to a development machine. etc.
  4. 复制到开发计算机。等等

4 个解决方案

#1


1  

I would create an empty shell database locally, then use one of the many schema comparison solutions available to make the local database look exactly like the cloud database.

我将在本地创建一个空的shell数据库,然后使用许多可用的模式比较解决方案之一使本地数据库看起来与云数据库完全一样。

#2


2  

Moving a SQL-Server DB is not that hard. Look here for some methods to do it.

移动SQL-Server数据库并不难。在这里寻找一些方法来做到这一点。

http://support.microsoft.com/kb/314546

I usually find the sp_detach + sp_attach method really easy.

我经常发现sp_detach + sp_attach方法非常简单。

#3


0  

Correct way is to create and regularly update your standalone copy of database using import/export. In particular MS SQL Server provides Import/Export Wizard tool for such purpose.

正确的方法是使用导入/导出创建并定期更新数据库的独立副本。特别是MS SQL Server为此目的提供了导入/导出向导工具。

#4


0  

  1. Make a backup
  2. 做一个备份

  3. Copy backup file
  4. 复制备份文件

  5. Restore on your server
  6. 在服务器上还原

  7. Restore/organise users

#1


1  

I would create an empty shell database locally, then use one of the many schema comparison solutions available to make the local database look exactly like the cloud database.

我将在本地创建一个空的shell数据库,然后使用许多可用的模式比较解决方案之一使本地数据库看起来与云数据库完全一样。

#2


2  

Moving a SQL-Server DB is not that hard. Look here for some methods to do it.

移动SQL-Server数据库并不难。在这里寻找一些方法来做到这一点。

http://support.microsoft.com/kb/314546

I usually find the sp_detach + sp_attach method really easy.

我经常发现sp_detach + sp_attach方法非常简单。

#3


0  

Correct way is to create and regularly update your standalone copy of database using import/export. In particular MS SQL Server provides Import/Export Wizard tool for such purpose.

正确的方法是使用导入/导出创建并定期更新数据库的独立副本。特别是MS SQL Server为此目的提供了导入/导出向导工具。

#4


0  

  1. Make a backup
  2. 做一个备份

  3. Copy backup file
  4. 复制备份文件

  5. Restore on your server
  6. 在服务器上还原

  7. Restore/organise users