# migration()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/domain/migration/
Language: zh

`domain.migration() → Promise<Plan>`

将现在的登记员指向我们 打破了任何东西吗? 它将三个领域的观点和答案进行对比。自由,它没有改变。

Status: free · writes nothing · read it before you advise

```javascript
const plan = await domain.migration();

if (!plan.safeToSwitch) {
  console.log("would break:", plan.risks.join(", "));
  await domain.records.import();
}
```

## 返回值 {#returns}

```javascript
{
  servedBy: ["…", "…"],          // who serves the domain right now
  nameservers: ["…", "…"],       // what to set at the registrar
  safeToSwitch: false,
  counts: { found: 23, inZone: 0, missing: 15, opaque: 8 },
  missing: [{ type, name, content, reason }],   // live elsewhere, absent here
  opaque:  [{ type, name, content, reason }],   // a proxy address: the origin is invisible
  unseen:  [{ type, name, reason }],            // seen by querying, not by the search
  risks: ["mail in service", "DKIM signature", "a live site"],
  alreadyServed: false,
}
```

## 比较 {#three-views}

- 在当前主机中找到什么 。
- 当直接询问时域答案是什么 。
- 我们的区已经维持了

前两个记录中的任何一个记录 第三个没有记录 就会停止

## 缺少和不透明是不一样的, 这就是关键 {#opaque}

> **不可复制不透明记录**
>
> 在代理服务器后面,你从外部看到的是代理服务器的地址,而不是来源。复制它会将域标到一个从未听说过的服务器上。它们被单独列出,进口()却跳过它们。

`opaque` 被计算为每个名字一次,而不是每个地址:代理服务器后面的同一名字根据询问者的不同而回答不同的地址。

## 风险是要显示的句子 {#risks}

服务邮件,a DKIM 用户在被告知改变任何事物之前,需要读到这个网址。

## 已经已已服务 {#already}

当切换完成后, 问题不再适用, 这里没有什么是警告 。

- [records.import()](/zh/sdk/ref/domain/records/import): 复制找到的东西
- [check()](/zh/sdk/ref/domain/check): 开关后

```python
plan = domain.migration()

if not plan["safeToSwitch"]:
    print("would break:", ", ".join(plan["risks"]))
    domain.records.import_zone()
```

```python
{
    "servedBy": ["…", "…"],          # who serves the domain right now
    "nameservers": ["…", "…"],       # what to set at the registrar
    "safeToSwitch": False,
    "counts": {"found": 23, "inZone": 0, "missing": 15, "opaque": 8},
    "missing": [{"type": ..., "name": ..., "content": ..., "reason": ...}],   # live elsewhere, absent here
    "opaque": [{"type": ..., "name": ..., "content": ..., "reason": ...}],    # a proxy address: the origin is invisible
    "unseen": [{"type": ..., "name": ..., "reason": ...}],                    # seen by querying, not by the search
    "risks": ["mail in service", "DKIM signature", "a live site"],
    "alreadyServed": False,
}
```
