---
title: "Migrate domains from DNS hosting (legacy) to Selectel DNS hosting (actual)"
sidebar_label: "Migrate domains from DNS hosting (legacy)"
description: "How to migrate domains from DNS hosting (legacy) to DNS hosting (actual) via the control panel or using octoDNS"
sidebar_position: 2
---

import Formbricks from '@theme/MDXComponents/Formbricks'

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import CopyIcon from '@selectel/docux/icons/copy'
import TrashIcon from '@selectel/docux/icons/trash'

# Migrate domains from DNS hosting (legacy) to Selectel DNS hosting (actual)

:::warning

We have released a [new version of DNS hosting (actual](https://my.selectel.ru/dns/default/hosting)) and are gradually disabling the [legacy version (legacy](https://my.single.selectel.ru/network/domains)) according to the [migration stages](/dns-hosting/about-dns.mdx#legacy-shutdown-stages).

[Migrate domains to DNS hosting (actual](/dns-hosting/move-domain/move-from-legacy-to-actual.mdx)) now to avoid site downtime when DNS hosting (legacy) is discontinued.

If you registered after January 30, 2024, only [DNS hosting (actual](https://my.selectel.ru/dns/default/hosting)) is available to you.

:::

Domain migration occurs without DNS downtime. You create a copy of the data from DNS hosting (legacy) in DNS hosting (actual) and then delegate record management to the authoritative servers of DNS hosting (actual). The migration may take up to 72 hours; during this time, records will continue to be served by the authoritative servers of DNS hosting (legacy).

If a domain in DNS hosting (legacy) only has NS and SOA records, it will not be migrated to DNS hosting (actual). If you need to migrate such a domain, you must [add it via the control panel](/dns-hosting/quickstart.mdx).

All domains from DNS hosting (legacy) are migrated to one [project](/access-control/projects/about-projects.mdx).

You can migrate domains:

* [via the control panel](#transfer-via-panel);
* [via octoDNS](#transfer-via-octodns).

After migration to DNS hosting (actual), you can [transfer the domain zone to another project](/dns-hosting/zones/transfer-zone.mdx).

## Migrate domains via the control panel \{#transfer-via-panel}

1. [Migrate the data](#transfer-data-panel).
2. [Delegate the domain to DNS hosting (actual)](#delegate-domain-panel).

### 1. Migrate data \{#transfer-data-panel}

1. In the [control panel](https://my.selectel.ru/network/domains), on the top menu, click **Products** and select **DNS hosting Legacy**.

2. Click **Copy zones to DNSv2**.

3. Select the [project](/access-control/projects/) to which you need to migrate the zones.

4. Click **Copy**. When the window closes, the migration will be complete.

5. To check the migration result, on the top menu, click **Products** and select **DNS hosting**.

6. Ensure you are in the project to which you migrated the data.

7. Check that the migrated domains appear in the zones list, and that the migrated domain records appear on each zone's page.

   Resource records of one type are displayed as a group of records. NS and SOA resource records are not migrated; they will be automatically created in DNS Hosting (actual) with default values that cannot be edited:

   * NS — `a.ns.selectel.ru.`, `b.ns.selectel.ru.`, `c.ns.selectel.ru.`, `d.ns.selectel.ru`.
   * SOA — `a.ns.selectel.ru. support.selectel.ru.` `<zone_serial_number> 10800 3600 604800 60`, where `<zone_serial_number>` is the zone serial number, which changes when the zone is updated and signals to caching servers that the records need to be re-cached.

   If data was migrated incorrectly or incompletely, [create a ticket](https://my.selectel.ru/tickets/create).

### 2. Delegate domain to DNS hosting (actual) \{#delegate-domain-panel}

If you migrated multiple domains, you must delegate each one.

1. Go to the control panel of the domain registrar where your domain is registered.
2. In the NS records, replace the values with the NS servers of DNS hosting (actual): `a.ns.selectel.ru`, `b.ns.selectel.ru`, `c.ns.selectel.ru`, `d.ns.selectel.ru`. Specify each server in a separate record.
3. Wait for the migrated resource records to propagate to the DNS servers. Record propagation may take up to 72 hours; during this time, records will continue to be served from the authoritative servers of DNS hosting (legacy): `ns1.selectel.ru`, `ns2.selectel.ru`, `ns3.selectel.ru`, `ns4.selectel.ru`.
4. Optional: [check the records on the authoritative servers](/dns-hosting/records/check-records.mdx).

## Migrate domains via octoDNS \{#transfer-via-octodns}

1. [Install octoDNS](#install-octodns).
2. [Migrate data](#transfer-data-octodns).
3. [Delegate the domain to DNS hosting (actual)](#delegate-domain-octodns).

### 1. Install octoDNS \{#install-octodns}

1. Install Python 3, virtualenv, and pip3:

   <Tabs queryString="install-components">
     <TabItem value="linux" default>
       <TabItemLabel>
         Linux
       </TabItemLabel>

       ```bash
       sudo apt-get update
       sudo apt-get install python3 virtualenv
       sudo apt-get install python3-pip
       ```
     </TabItem>

     <TabItem value="macos">
       <TabItemLabel>
         macOS
       </TabItemLabel>

       ```bash
       brew install python3
       brew install virtualenv
       ```
     </TabItem>
   </Tabs>

2. Create a directory for octoDNS:

   ```bash
   mkdir ~/octodns
   ```

3. Go to the `~/octodns:` directory:

   ```bash
   cd ~/octodns
   ```

4. Create a virtual environment for octoDNS:

   ```bash
   virtualenv env
   ```

5. Activate the virtual environment:

   ```bash
   source env/bin/activate
   ```

6. Install octoDNS in the virtual environment:

   ```bash
   pip3 install octodns
   ```

7. Check that the package was installed correctly:

   ```bash
   octodns-sync --version
   ```

   The response will show the installed octoDNS version, for example:

   ```bash
   octoDNS 1.4.0
   ```

8. Install the [Selectel provider](https://github.com/octodns/octodns-selectel) for octoDNS:

   ```bash
   pip3 install octodns_selectel
   ```

9. Check that the Selectel provider was installed correctly:

   ```bash
   pip3 list | grep octodns-selectel
   ```

   The response will show the installed provider version, for example:

   ```bash
   octodns_selectel 0.99.1
   ```

   The minimum version of the Selectel provider for migration is `0.99.1`.

### 2. Migrate data \{#transfer-data-octodns}

1. Go to the `~/octodns:` directory:

   ```bash
   cd ~/octodns
   ```

2. Create a `migration_config.yaml:` file:

   ```bash
   nano migration_config.yaml
   ```

3. Copy the contents into the file:

   ```yaml
   ---
   processors:
     no-root-ns:
       class: octodns.processor.filter.IgnoreRootNsFilter

   providers:
     selectel_legacy:
       class: octodns_selectel.SelectelProviderLegacy
       token: <x_token>
     selectel:
       class: octodns_selectel.SelectelProvider
       token: <x_auth_token>

   zones:
       <example.com.>:
           sources:
           - selectel_legacy
           processors:
           - no-root-ns
           targets:
           - selectel
   ```

   Specify:

   * `<x_token>` — [static token (X-Token](/api/authorization/));
   * `<x_auth_token>` — [IAM token for the project](/api/authorization/#iam-token-project-scoped) to which you want to migrate data;
   * `<example.com.>` — domain name as it appears in DNS hosting (legacy), with a trailing dot. To migrate all domains, specify `"*"` without a dot instead of the domain name.

4. Start the migration:

   ```bash
   octodns-sync --config-file=migration_config.yaml --doit
   ```

5. In the [control panel](https://my.selectel.ru/dns/default/hosting/), on the top menu, click **Products** and select **DNS hosting**.

6. Ensure you are in the project to which you migrated the data.

7. Check that the migrated domains appear in the zones list, and that the migrated domain records appear on each zone's page.

   Resource records of one type are displayed as a group of records. NS and SOA resource records are not migrated; they will be automatically created in DNS Hosting (actual) with default values:

   * NS — `a.ns.selectel.ru.`, `b.ns.selectel.ru.`, `c.ns.selectel.ru.`, `d.ns.selectel.ru`.
   * SOA — `a.ns.selectel.ru. support.selectel.ru.` `<zone_serial_number> 10800 3600 604800 60`, where `<zone_serial_number>` is the zone serial number, which changes when the zone is updated and signals to caching servers that the records need to be re-cached.

   If data was migrated incorrectly or incompletely, [create a ticket](https://my.selectel.ru/tickets/create).

### 3. Delegate domain to DNS hosting (actual) \{#delegate-domain-octodns}

If you migrated multiple domains, you must delegate each one.

1. Go to the control panel of the domain registrar where your domain is registered.
2. In the NS records, replace the values with the NS servers of DNS hosting (actual): `a.ns.selectel.ru`, `b.ns.selectel.ru`, `c.ns.selectel.ru`, `d.ns.selectel.ru`. Specify each server in a separate record.
3. Wait for the migrated resource records to propagate to the DNS servers. Record propagation may take up to 72 hours; during this time, records will continue to be served from the authoritative servers of DNS hosting (legacy): `ns1.selectel.ru`, `ns2.selectel.ru`, `ns3.selectel.ru`, `ns4.selectel.ru`.
4. Optional: [check the records on the authoritative servers](/dns-hosting/records/check-records.mdx).

<Formbricks />
