# records.import()

Canonical URL: https://developers.iagenify.com/sdk/ref/domain/records/import/
Language: en

`domain.records.import(zoneFile?) → Promise<{ added, parsed, skipped }>`

Copies what the domain served elsewhere into our zone. Without an argument it takes what the search found — skipping the records that must not be copied.

Status: the takeover · skips opaque records · a zone file is the reliable path

```javascript
await domain.records.import();              // what the search found
await domain.records.import(zoneFileText);  // a zone file from the old host
```

## A zone file is the reliable path {#zonefile}

> **Only it carries the real lifetimes and the records nothing can observe**
>
> Observation finds what answers; it cannot enumerate. A zone file holds everything, with its real values, and most hosts can export one. Without it you are copying what was visible.

## What is skipped, and why {#skipped}

| Skipped | Because |
| --- | --- |
| An opaque address | It is a proxy's, not the origin's. Copying it points the domain at a service that has never heard of it. |
| `NS` and the zone's authority records | They would delegate back to the host being left. |

The opaque ones stay listed in [migration().opaque](/sdk/ref/domain/migration) — to finish by hand, or with a zone file.

## Returns {#returns}

```javascript
{ added: 15, parsed: 23, skipped: [{ type, name, reason }] }
```

Read `skipped`: it is the list of what is still missing, and each entry says why.

## Records are created, one by one {#records-created}

Each one goes through the ordinary path, and the result is reported per record. A record that did not land is named rather than lost in a batch result — run the import again, or write the missing one.

## Verify before advising a switch {#verify}

```javascript
await domain.records.import();
const plan = await domain.migration();
if (plan.safeToSwitch) { /* now the registrar can be pointed here */ }
```

- [migration()](/sdk/ref/domain/migration): Is switching safe yet?
- [records.list()](/sdk/ref/domain/records/list): Checking the result.

```python
domain.records.import_zone()                 # what the search found
domain.records.import_zone(zone_file_text)   # a zone file from the old host
```

```python
{"added": 15, "parsed": 23, "skipped": [{"type": ..., "name": ..., "reason": ...}]}
```

```python
domain.records.import_zone()
plan = domain.migration()
if plan["safeToSwitch"]:
    pass  # now the registrar can be pointed here
```
