sql - 如何将本地服务器上运行的数据库迁移到另一台机器上
问题描述
我在 SSMS 18 中构建了一个关系数据库,并用一些数据填充了它。我即将退回我新买的笔记本电脑,我的数据库当前正在运行,因此我想知道将数据库(表、数据、关系......)迁移到新电脑的本地服务器的最简单方法是什么。
我只是想确保在重置电脑之前,我已经备份了恢复数据库所需的所有文件,然后再返回它
解决方案
使用内置备份工具备份数据库。这将创建整个数据库的备份。然后,您将备份创建的文件复制到目标计算机,并从备份程序创建的文件中恢复数据库。
1) Select the database you want to back up in SQL Server Management Studio on your left.
2) Right Click and select 'Tasks.'
3) Click on backup in the popup menu.
4) Note where the backup files are going in the file system.
5) Run the backup
6) Copy the files from the backup to the target machine.
7) In the target machine start SQL Server Management Studio.
8) Select 'Databases.'
9) Right click and select Restore Databases/
10) Click on devices and select your physical backup files you copied in step 6.
11) Restore the database.
推荐阅读
- swift - 在 Xcode 中,我可以使用 firebase 上传我的 Swift 应用程序,但我无法将数据从 firestore 导入我的应用程序。解决办法是什么?
- powershell - 使用扩展变量创建脚本块
- r - ggplot2-如何在热图中使用条件颜色
- reactjs - 是否有一个属性我可以检查代码是否使用 hydrate vs render 呈现?
- sql-server - Dbeaver 与 sql server 如何在一次运行中设置多个变量?
- pyspark - TypeError:“列”对象不可调用
- javascript - 如何使用 css flexbox 在文本输入中创建一个按钮?
- r - R中foreach的并行循环-对象未找到
- java - 带有 JBoss eap 7.1 的 Java EE - 在运行时以编程方式提供数据源用户名和密码
- python - 使用范围列表创建 Python 工作表