热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

azure虚拟机部署iis

In one of my articles about Microsoft Azure, I show how to create credentials and how to connect to an Azure Database using SQL Server Management Studio (SSMS). In this new article, we will talk about the Azure Virtual Machines and we will learn how to connect to them using our local SSMS. You will require unblocking ports, add endpoints and other tasks that I will explain later. We will also learn how to export a local database to an Azure Virtual Machine with SQL Server installed.

在我的有关Microsoft Azure的文章中 ,我展示了如何创建凭据以及如何使用SQL Server Management Studio(SSMS)连接到Azure数据库。 在这篇新文章中,我们将讨论Azure虚拟机,并将学习如何使用本地SSMS连接到它们。 您将需要取消阻塞端口,添加端点和其他任务,我将在后面解释。 我们还将学习如何将本地数据库导出到安装了SQL Server的Azure虚拟机。

要求 ( Requirements )

In this example, we will require an Azure Virtual Machine installed, a local machine with SQL Server and SSMS installed, the Cloud Adapter (we are including the steps to configure it) and a certificate which will also be explained in this section.

在此示例中,我们将需要安装Azure虚拟机,安装了SQL Server和SSMS的本地计算机,云适配器(我们包括配置它的步骤)和证书,本节还将对此进行说明。

  1. You will require an Azure Virtual Machine with SQL Server installed. To create an Azure Account, review this link. To create a virtual machine, review this link.

    您将需要安装了SQL Server的Azure虚拟机。 要创建一个Azure帐户,请查看此链接 。 要创建虚拟机,请查看此链接 。
  2. A local machine with the SQL Server Engine Installed and a database to export with access to internet.

    The Cloud Adapter

    1. A Cloud Adapter. The cloud adapter is an Azure Service required for SQL Server and generates a SSL certificate In the Azure portal. In order to create it, go to Virtual Machines and click on the virtual machine name.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      Figure r1. The Azure virtual machines.
    2. Click on EndPoints.


      Figure r2. The Endpoints

    3. Press the New icon.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      Figure r3. Add new endpoints
    4. Add the Endpoint name, protocol and port (by default it is the port 11435).


      Figure r4. The cloud Adapter for SQL

    A certificate

    Another requirement is a certificate to connect to the Cloud. In order to do it do the following steps:

    1. Open the certmgr.msc. You can create your certificate or use an existing one. In this example we will use an existing one.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R5. The certificate console
    2. Select the certificate right click and select All Tasks>Export


      R6. Export a certificate
    3. The wizard to export certificates will be displayed. Click next.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R7. Export Wizard.
    4. Select if you want to have a private key.


      R8. Private key question

    5. Specify the format of the certificate.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R9. Select the certify format
    6. Specify a name and a path.


      R10. Selecting name and path of the .cer file.

    7. Once the Wizard is completed, press finish.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R11. Final step of the export wizard.
    8. Go to the Azure portal and click on the Virtual Machine.


      R12. The virtual machine.

    9. Click on the Management Certificates link.

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机
      R13. The certificates

    10. Click the Upload button and upload the certificate created on step 7.


      R14. The option to upload certificates.

    11. Getting Started

      1. To connect to a Virtual Machine, you can use the SQL Server Account. In order to enable the SQL Server authentication, in the Azure Virtual Machine (VM), open the SSMS and connect to the database. Right click on your Server and select properties. Change the Server Authentication to SQL Server and Windows Authentication to connect from your local machine.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机
        Figure 1. Server properties

      2. You will be prompted a message about restarting the SQL Server Service.


        Figure 2. Information message.

      3. Restart the Service in order for the new configuration to take effect.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 3. Restarting the MSSQL Service
      4. Now that the SQL Server authentication is enabled, create a SQL Server Login.


        Figure 4. Creating a new login.

      5. Specify the login name and passwords. It is recommended to enforce the password policy for security reasons. In this example, we will omit the Enforce password policy to simplify the example.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 5. Login settings
      6. Go to the Virtual Machine in the Azure Portal and click on the Virtual Machine name.


        Figure 6. The virtual machine status

      7. Click the ENDPOINTS link and press the Add icon to add a new Endpoint.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机
        Figure 7. Endpoints

      8. Select the add Standalone Endpoint


        Figure 8. Adding endpoint

      9. Write the name of the Endpoint. The protocol should be TCP and the port by default in the default instance is 1433.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 9. Endpoint settings
      10. The ACL allows you to specify the range of subnets allowed to access to your Azure virtual Machine. You can provide the name and subnet. If you do not your Internet IP, you can use this link.


        Figure 10. The ACL details

      11. You also need to enable the ports used to access remotely. Go to the Windows Firewall and right click on the Inbound Rules and select new rule.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 11. The Inbound rules.
      12. Specify the port to which you want to apply a rule. In this case, it is the port 1433.


        Figure 12. The TCP IP SQL Server port

      13. In the action, select the allow the connection option.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 13. Allow permissions

      14. Select the rule that you want to apply.


        Figure 14. Rules to apply

      15. Write a name for the rule.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 15. Rule name

      16. Now connect to your Azure VM from the SSMS of the local machine.

        Figure 16. Connect to an Azure VM from the local SSMS

        If everything is OK you can now connect to the SQL Server machine with Azure from your local machine.

      How to deploy your database using the Deploy Database to Windows Azure VM

      Now we will export our local database to the Azure Vm.

      1. In the local SSMS, Select the database that you want to copy and select Tasks>Deploy Database to Windows Azure.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 17. The Deploy Database to Azure VM Wizard.
      2. The Introduction Wizard Windows will be displayed.


        Figure 18. The Introduction Wizard.

      3. Press the Connect button to connect to the local SQL Server.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 19. The local machine information

      4. Specify the Server name and credentials and press Connect.


        Figure 20. The local machine credentials.

      5. Select a database to export and a temporary location for the backup files. Make sure that the SQL Server has permissions on a temporary location.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 21. The Database to export and the temporary file.
      6. To connect to Azure, you will need a Certificate. You can also work with a publishing profile. For more information about a publishing profile.


        Figure 22. Certificate.

      7. Press the Select button and select the certificate created on the requirements section of this article. Copy the subscription ID of step 9 of the requirements in the certificate section.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 23. The subscription ID.

      8. Specify the Cloud Service name, Virtual Machine name and Storage Account and then press Settings.


        Figure 24. The subscription ID.

      9. Specify the Virtual Machine, your credentials and the Cloud Adapter port. Verify in the requirements the port used. By default, it is the port 11435.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 25. Cloud Adapter information.
      10. You will receive a message about the certificate. If you agree, press Trust Publisher and connect.


        Figure 26. The Trust message.

      11. Finally you will have your information like this:

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 27. The Azure VM information and the Local SQL Server information
      12. If everything is OK, the summary window will be displayed.


        Figure 28. Summary Window

      13. Finally, you will receive the results windows that will be green if everything is OK.

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        Figure 29. The Results wizard.
      14. To verify that the database was copied successfully, go to the virtual machine and verify that the database was copied successfully.

      Conclusion

      In this tutorial, we’ve learned how to connect to an Azure virtual machine with SQL Server using our local SQL Server. We also learned how to export a local database to a SQL Server Azure VM.

    安装了SQL Server引擎的本地计算机和要访问Internet的要导出的数据库。

    云适配器

    1. 云适配器。 云适配器是SQL Server必需的Azure服务,并在Azure门户中生成SSL证书。 为了创建它,请去虚拟机并且点击虚拟机名称。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      图r1。 Azure虚拟机。
    2. 单击端点。


      图r2。 终点

    3. 按“新建”图标。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      图r3。 添加新端点
    4. 添加端点名称,协议和端口(默认情况下为端口11435)。


      图r4。 适用于SQL的云适配器

    证书

    另一个要求是连接到云的证书。 为此,请执行以下步骤:

    1. 打开certmgr.msc。 您可以创建证书或使用现有证书 。 在此示例中,我们将使用现有示例。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R5。 证书控制台
    2. 右键单击证书,然后选择“所有任务”>“导出”


      R6。 导出证书
    3. 将显示导出证书的向导。 点击下一步。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R7。 导出向导。
    4. 选择是否要使用私钥。


      R8。 私人 关键 问题

    5. 指定证书的格式。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R9。 选择认证格式
    6. 指定名称和路径。


      R10。 选择名称和路径 cer 文件。

    7. 向导完成后,按完成。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

      R11。 导出向导的最后一步。
    8. 转到Azure门户,然后单击“虚拟机”。


      R12。 虚拟机。

    9. 单击管理证书链接。

      azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机
      R13。 证书

    10. 单击上载按钮,然后上载在步骤7中创建的证书。


      R14。 上传证书的选项。

    11. 入门

      1. 要连接到虚拟机,您可以使用SQL Server帐户。 为了启用SQL Server身份验证,请在Azure虚拟机(VM)中,打开SSMS并连接到数据库。 右键单击服务器,然后选择属性。 将服务器身份验证更改为SQL Server和Windows身份验证以从本地计算机连接。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机
        图1. 服务器属性

      2. 系统将提示您有关重新启动SQL Server服务的消息。


        图2. 信息消息。

      3. 重新启动服务,以使新配置生效。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图3.重新启动MSSQL服务
      4. 现在已启用SQL Server身份验证,请创建一个SQL Server登录名。


        图4.创建一个新的登录名。

      5. 指定登录名和密码。 出于安全原因,建议强制执行密码策略。 在此示例中,我们将省略“强制密码”策略以简化示例。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图5.登录设置
      6. 转到Azure门户中的虚拟机,然后单击虚拟机名称。


        图6.虚拟机状态

      7. 单击ENDPOINTS链接,然后按添加图标以添加新的端点。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机
        图7.端点

      8. 选择添加独立端点


        图8. 添加端点

      9. 输入端点的名称。 该协议应为TCP,默认实例中的默认端口为1433。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图9.端点设置
      10. ACL允许您指定允许访问Azure虚拟机的子网范围。 您可以提供名称和子网。 如果您没有Internet IP,则可以使用此链接 。


        图10. ACL详细信息

      11. 您还需要启用用于远程访问的端口。 转到Windows防火墙,然后右键单击“入站规则”,然后选择新规则。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图11.入站规则。
      12. 指定要对其应用规则的端口。 在这种情况下,它是端口1433。


        图12. TCP IP SQL Server端口

      13. 在操作中,选择“允许连接”选项。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图13. 允许权限

      14. 选择您要应用的规则。


        图14. 适用规则

      15. 为规则写一个名字。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图15.规则名称

      16. 现在,从本地计算机的SSMS连接到您的Azure VM。

        图16. 从本地SSMS连接到Azure VM

        如果一切正常,您现在可以从本地计算机使用Azure连接到SQL Server计算机。

      如何使用将数据库部署到Windows Azure VM来部署数据库

      现在,我们将本地数据库导出到Azure Vm。

      1. 在本地SSMS中,选择要复制的数据库,然后选择“任务”>“将数据库部署到Windows Azure”。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图17.将数据库部署到Azure VM向导。
      2. 将显示“简介向导”窗口。


        图18.简介向导。

      3. 按“连接”按钮连接到本地SQL Server。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图19. 本地机器信息

      4. 指定服务器名称和凭据,然后按连接。


        图20.本地计算机凭据。

      5. 选择要导出的数据库和备份文件的临时位置。 确保SQL Server对临时位置具有权限。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图21.要导出的数据库和临时文件。
      6. 若要连接到Azure,您将需要一个证书。 您也可以使用发布配置文件。 有关发布配置文件的更多信息。


        图22 证书。

      7. 按“选择”按钮,然后选择在本文的“需求”部分上创建的证书。 在证书部分中复制需求的步骤9的订阅ID。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图23.订阅ID。

      8. 指定云服务名称,虚拟机名称和存储帐户,然后按设置。


        图2 4 订阅ID。

      9. 指定虚拟机,您的凭据和云适配器端口。 在要求中验证使用的端口。 默认情况下,它是端口11435。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图25.云适配器信息。
      10. 您将收到有关证书的消息。 如果您同意,请按Trust Publisher并进行连接。


        图26.信任消息。

      11. 最后,您将获得如下信息:

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图27. Azure VM信息和本地SQL Server信息
      12. 如果一切正常,将显示“摘要”窗口。


        图28.摘要窗口

      13. 最后,如果一切正常,您将收到绿色的结果窗口。

        azure虚拟机部署iis_如何将数据库迁移到Azure虚拟机

        图29.结果向导。
      14. 要验证数据库是否已成功复制,请转到虚拟机并验证数据库是否已成功复制。

      结论

      在本教程中,我们学习了如何使用本地SQL Server通过SQL Server连接到Azure虚拟机。 我们还学习了如何将本地数据库导出到SQL Server Azure VM。

翻译自: https://www.sqlshack.com/migrate-your-database-to-an-azure-virtual-machine/

azure虚拟机部署iis


推荐阅读
  • 在项目部署后,Node.js 进程可能会遇到不可预见的错误并崩溃。为了及时通知开发人员进行问题排查,我们可以利用 nodemailer 插件来发送邮件提醒。本文将详细介绍如何配置和使用 nodemailer 实现这一功能。 ... [详细]
  • MySQL 数据库迁移指南:从本地到远程及磁盘间迁移
    本文详细介绍了如何在不同场景下进行 MySQL 数据库的迁移,包括从一个硬盘迁移到另一个硬盘、从一台计算机迁移到另一台计算机,以及解决迁移过程中可能遇到的问题。 ... [详细]
  • 基于KVM的SRIOV直通配置及性能测试
    SRIOV介绍、VF直通配置,以及包转发率性能测试小慢哥的原创文章,欢迎转载目录?1.SRIOV介绍?2.环境说明?3.开启SRIOV?4.生成VF?5.VF ... [详细]
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • 本文深入探讨了Linux系统中网卡绑定(bonding)的七种工作模式。网卡绑定技术通过将多个物理网卡组合成一个逻辑网卡,实现网络冗余、带宽聚合和负载均衡,在生产环境中广泛应用。文章详细介绍了每种模式的特点、适用场景及配置方法。 ... [详细]
  • 使用Vultr云服务器和Namesilo域名搭建个人网站
    本文详细介绍了如何通过Vultr云服务器和Namesilo域名搭建一个功能齐全的个人网站,包括购买、配置服务器以及绑定域名的具体步骤。文章还提供了详细的命令行操作指南,帮助读者顺利完成建站过程。 ... [详细]
  • 在Python开发过程中,随着项目数量的增加,不同项目依赖于不同版本的库,容易引发依赖冲突。为了避免这些问题,并保持开发环境的整洁,可以使用Virtualenv和Virtualenvwrapper来创建和管理多个隔离的Python虚拟环境。 ... [详细]
  • 本文详细介绍了在腾讯云服务器上配置 phpMyAdmin 的方法,包括安装、配置和解决常见问题。通过这些步骤,您可以轻松地在腾讯云环境中部署并使用 phpMyAdmin。 ... [详细]
  • 本文介绍了如何使用JavaScript的Fetch API与Express服务器进行交互,涵盖了GET、POST、PUT和DELETE请求的实现,并展示了如何处理JSON响应。 ... [详细]
  • 简化报表生成:EasyReport工具的全面解析
    本文详细介绍了EasyReport,一个易于使用的开源Web报表工具。该工具支持Hadoop、HBase及多种关系型数据库,能够将SQL查询结果转换为HTML表格,并提供Excel导出、图表显示和表头冻结等功能。 ... [详细]
  • 本文将深入探讨如何在不依赖第三方库的情况下,使用 React 处理表单输入和验证。我们将介绍一种高效且灵活的方法,涵盖表单提交、输入验证及错误处理等关键功能。 ... [详细]
  • 解决Anaconda安装TensorFlow时遇到的TensorBoard版本问题
    本文介绍了在使用Anaconda安装TensorFlow时遇到的“Could not find a version that satisfies the requirement tensorboard”错误,并提供详细的解决方案,包括创建虚拟环境和配置PyCharm项目。 ... [详细]
  • 在创建新的Android项目时,您可能会遇到aapt错误,提示无法打开libstdc++.so.6共享对象文件。本文将探讨该问题的原因及解决方案。 ... [详细]
  • 中科院学位论文排版指南
    随着毕业季的到来,许多即将毕业的学生开始撰写学位论文。本文介绍了使用LaTeX排版学位论文的方法,特别是针对中国科学院大学研究生学位论文撰写规范指导意见的最新要求。LaTeX以其精确的控制和美观的排版效果成为许多学者的首选。 ... [详细]
  • Redux入门指南
    本文介绍Redux的基本概念和工作原理,帮助初学者理解如何使用Redux管理应用程序的状态。Redux是一个用于JavaScript应用的状态管理库,特别适用于React项目。 ... [详细]
author-avatar
mmmmGi_626
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有