---
schema_version: "1"
id: b7a14df5125157acefff3bc32bd819d8750b00e2a68cd5015bcd1509f436dfca
title: 将 Tableau Server 从本地计算机迁移到云中的 VM
collection: tableau
version: current
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/current/zh-cn/server/migrate_on-prem_to_cloud.md
canonical_url: https://help.tableau.com/current/server/zh-cn/migrate_on-prem_to_cloud.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 92d1137dc5c7efb73914bf4daff415cf24293f66e601a2bce653f82f19e66317
description: Migrate Tableau Server from an on-premises computer to a VM in the cloud.
---
[跳转到主要内容](#main-content)

# 将 Tableau Server 从本地计算机迁移到云中的 VM

您可以将 Tableau Server 从数据中心中的计算机迁移到云中的虚拟机 (VM)。在此迁移过程中，您需要将各种 Tableau Server 数据和配置设置从本地计算机移动到云中安装了 Tableau Server 的 VM。

**注意：**此操作包括您可能需要使用 TSM 命令行执行的步骤。若要使用 TSM CLI，您需要在安装中的一个节点上对命令行具有管理员访问权限，并需要 TSM 管理员凭据来运行 TSM 命令。

### 先决条件

在将 Tableau Server 从本地计算机迁移到云中的 VM 之前，请确保查看以下先决条件：

- 在云提供程序上设置帐户和环境。有关详细信息，请参见：
    - [在 Amazon Web 服务上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_aws_welcome.htm)
    - [在 Google 云平台上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_gcp_welcome.htm)
    - [在 Microsoft Azure 上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_azure_welcome.htm)
    - [在阿里云上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_alibaba_welcome.htm)
- 阅读[准备升级](https://help.tableau.com/current/server/zh-cn/server-upgrade-prepare.htm)和[备份 Tableau Server 数据](https://help.tableau.com/current/server/zh-cn/db_backup.htm)以做好迁移准备。

### 将 Tableau Server 迁移到云中的 VM

1. 确保没有正在运行的后台任务，例如数据提取刷新、工作簿发布等。在 Tableau Server 处于空闲状态时，记下正在使用的任何数据源连接类型，以便能够在云中的 VM 上针对新的 Tableau Server 安装相应的驱动程序。
2. 停止 Tableau Server。在命令提示符处，键入：
    
    [`tsm stop`](https://help.tableau.com/current/server/zh-cn/cli_stop_tsm.htm)
3. Tableau Server 停止之后，进行完整备份，并执行[准备升级](https://help.tableau.com/current/server/zh-cn/server-upgrade-prepare.htm)和[备份 Tableau Server 数据](https://help.tableau.com/current/server/zh-cn/db_backup.htm)中的步骤。备份用于恢复您的 Tableau Server 数据。您将使用此备份在云中的 VM 上还原 Tableau Server 数据。
4. 将备份移出服务器并将其存储在安全的地方。例如，您可以将备份存储在诸如 Amazon S3、Google Drive 等云存储上。
5. 如果在本地服务器上使用 SSL，请建立 SSL 文件夹的备份。一定要注意任何安全性规则（例如，防火墙规则、端口等），以避免基础结构的不同元素与云中 VM 上的新 Tableau Server 之间出现通信问题。
6. 移除使用本地 Tableau Server 的 IP 地址的任何 DNS 条目，以便可将它们重新分配给云中 VM 上的 Tableau Server。
7. 将满足 Tableau Server 推荐要求的 VM 装入云中。
8. 在云中的 VM 上安装 Tableau Server。有关详细信息，请参见：
    - [在 Amazon Web 服务上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_aws_welcome.htm)
    - [在 Google 云平台上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_gcp_welcome.htm)
    - [在 Microsoft Azure 上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_azure_welcome.htm)
    - [在阿里云上安装 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_alibaba_welcome.htm)
9. 安装完成后，将任何 SSL 文件复制到云中 VM 上的 Tableau Server，并在新服务器上还原备份。
10. 在云中的 VM 上配置 Tableau Server，并安装所有 SSH 和端口相关事物。
    
    **注意：**如果更改数据库的 IP 地址/端口，您可能更新所有连接信息。
11. 将备份文件 _.tsbak_ 复制到 `basefilepath.backuprestore` 变量指定的文件夹位置。默认情况下，此位置为：`C:\ProgramData\Tableau\Tableau Server\data\tabsvc\files\backups\`。
    
    **注意：**您可以更改备份文件的位置。有关详细信息，请参见[tsm File Paths](https://help.tableau.com/current/server/zh-cn/cli_default_filepaths_tsm.htm)。
12. 接着，停止 Tableau Server。在命令提示符处，键入：
    
    [`tsm stop`](https://help.tableau.com/current/server/zh-cn/cli_stop_tsm.htm)
13. 将不含配置信息的生产数据还原到新的 Tableau Server 安装。在命令提示符处，键入：
    
    `[tsm maintenance restore](https://help.tableau.com/current/server/zh-cn/cli_maintenance_tsm.htm#tsm3) -f <filename>`
    
    其中 `<filename>` 是您在步骤 11 中复制的 _.tsbak_ 文件的名称。
    
    有关还原 Tableau Server 数据的详细信息，请参见[还原备份内容](https://help.tableau.com/current/server/zh-cn/db_restore.htm)。
14. 启动服务器。在命令提示符处，键入：
    
    [`tsm start`](https://help.tableau.com/current/server/zh-cn/cli_start_tsm.htm)
15. **仅限分布式安装**：在想要添加到云中的新 Tableau Server 群集的新 VM 上安装 Tableau Server。有关详细信息，请参见：
    - [安装和配置附加节点](https://help.tableau.com/current/server/zh-cn/install_additional_nodes.htm)
    - [在分布式环境中的 AWS 上自行部署 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_aws_multiple_server.htm)
    - [在分布式环境中的 Google 云平台上自行部署 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_gcp_multiple_server.htm)
    - [在分布式环境中的 Microsoft Azure 上自行部署 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_azure_multiple_server.htm)
    - [在分布式环境中的阿里云上自行部署 Tableau Server](https://help.tableau.com/current/server/zh-cn/ts_alibaba_multiple_server.htm)
16. 在云中的 VM 上测试 Tableau Server，确保其按预期方式工作。如果您的 Tableau Server 在云中工作正常，您可以停用本地 Tableau Server 产品密钥，并使用这个相同的产品密钥在云中的 VM 上激活 Tableau Server。
    
    **注意**：如果您未连接到 Internet，系统将提示您创建离线激活文件以完成停用过程。有关详细信息，请参见[脱机停用 Tableau Server](https://help.tableau.com/current/server/zh-cn/deactivate_off.htm)。
17. 同一 Tableau Server 产品密钥可激活三次：一次针对生产环境，一次针对测试环境，一次针对 QA 环境。在您测试了新 Tableau Server 安装并确认它可用于生产后，必须先停用然后卸载 Tableau Server 的早期生产版本。若要停用早期版本，请参见[tsm licenses deactivate](https://help.tableau.com/current/server/zh-cn/cli_licenses_tsm.htm#TSMDeactivate)。
    
    **注意**：如果您未连接到 Internet，系统将提示您创建离线激活文件以完成停用过程。有关步骤，请参见[脱机停用 Tableau Server](https://help.tableau.com/current/server/zh-cn/deactivate_off.htm)。