---
title: "Transfer file storage to another project"
sidebar_label: "Transfer file storage to another project"
sidebar_position: 5
toc_max_heading_level: 2
description: "How to transfer file storage to another project"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import CreateFileStorage from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/file-storage/create-file-storage.mdx'
import CreateGlobalRouter from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/global-router/create-global-router.mdx'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'

# Transfer file storage to another project

You can transfer file storage data to another project. To do this, you need to create a file storage in the target project and transfer the data from the source storage to the target one.

1. [Create a file storage in the target project](#create-file-storage-in-target-project).

2. [Create a cloud server in the target project](#create-cloud-server-in-target-project).

3. [Create a global router](#create-global-router).

4. [Add a port for the cloud server to the target project subnet](#add-server-port-to-target-private-network).

5. [Connect the network and subnet of the source and target projects to the global router](#connect-network-and-subnet-of-projects-to-router).

6. [Add a static route to the source project subnets](#add-static-route-to-source-project-subnet).

7. [Add a static route to the target project subnets](#add-static-route-to-target-project-subnet).

8. [Mount file storages and transfer data](#mount-file-storages-to-cloud-server-and-transfer-data).

## 1. Create a file storage in the target project \{#create-file-storage-in-target-project}

<CreateFileStorage />

## 2. Create a cloud server in the target project \{#create-cloud-server-in-target-project}

Follow the instructions in [Create a cloud server](/cloud-servers/create/create-server.mdx).

Select the private file storage subnet that you [created in step 1](#create-file-storage-in-target-project).

## 3. Create a global router \{#create-global-router}

<CreateGlobalRouter />

## 4. Add a port for the cloud server to the target project subnet \{#add-server-port-to-target-private-network}

Follow the instructions in [Add a port to a subnet](/cloud-servers/cloud-networks/ports.mdx#add-port-to-subnet).

Specify:

* the file storage subnet of the source project;
* IP address of the cloud server that you [created in step 2](#create-cloud-server-in-target-project).

## 5. Connect the source and target project networks and subnets to the router \{#connect-network-and-subnet-of-projects-to-router}

You need to connect the networks and subnets of the projects and cloud platform pools containing the source file storage and the target file storage with the cloud server to the global router.

1. Ensure that the network has not already been added to any global router in the account. In the [control panel](https://my.selectel.ru/vpc/default/networks/), in the top menu click **Products** → **Cloud Servers** → **Network** → **Private networks** tab → check that the network card does not have the **Global Router** tag.

2. Verify that the subnet meets the conditions:

   * belongs to the private address range per RFC 1918: `10.0.0.0/8`, `172.16.0.0/12` or `192.168.0.0/16`;
   * is at least `/29`, as three addresses will be occupied by Selectel network equipment;
   * does not overlap with other subnets added to this router: the IP addresses of each subnet on the router must not overlap with the IP addresses of other subnets on it.

3. In the [control panel](https://my.selectel.ru/vpc/default/networks/), from the top menu, click **Products** and select **Cloud Servers**.

4. Go to the **Network** section → **Private networks** tab.

5. From the <MoreVerticalIcon /> network menu, select **Connect to Global Router**.

6. Select a global router.

7. For the subnet of the source project, enter an IP address that will be assigned to the router, or leave the first available address from the subnet, which is assigned by default. Do not assign this address to your devices to avoid disrupting network operation. The last two available addresses in the subnet will be reserved as service addresses.

8. Click **Connect**. Do not close the window until the message appears that the network has been connected. After that, in the control panel:

   * the network will appear in the [section](https://my.selectel.ru/network/localnetwork/l3_list) **Selectel Global Router** on the page of the router to which you connected it;
   * the network will have the **Global Router** tag. You can view this in the [section](https://my.selectel.ru/vpc/default/networks/) **Cloud Servers** → **Network** → on the **Private networks** tab.

9. Repeat steps 5-8 for the target project subnet.

## 6. Add a static route to the source project subnet \{#add-static-route-to-source-project-subnet}

Add a static route from the subnet of the target project to the subnet of the source project. Use the guide [Configure static routes in a subnet](/cloud-servers/cloud-networks/static-routes.mdx#configure-static-routing-on-subnet).

Specify:

* destination subnet — the subnet of the target project where you [created file storage in step 1](#create-file-storage-in-target-project);
* gateway (next-hop) — the port of the global router that you [created in step 3](#create-global-router).

## 7. Add a static route to the target project subnet \{#add-static-route-to-target-project-subnet}

Add a static route from the subnet of the source project to the subnet of the target project. Use the guide [Configure static routes in a subnet](/cloud-servers/cloud-networks/static-routes.mdx#configure-static-routing-on-subnet).

Specify:

* destination subnet — the subnet of the source project where the source storage is located. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage): from the top menu, click **Products** → **File Storage** → in the file storage row, click the subnet name → **Subnets** tab → subnet card;
* gateway (next-hop) — the port of the global router that you [created in step 3](#create-global-router).

## 8. Mount file storages to the cloud server and transfer data \{#mount-file-storages-to-cloud-server-and-transfer-data}

:::warning

During data transfer, the resources of the file storage will be fully utilized. We recommend suspending work with the storage during the transfer.

:::

<Tabs queryString="mount-storage-to-cloud-server">
  <TabItem value="server-nfsv4" default>
    <TabItemLabel>
      NFSv4
    </TabItemLabel>

    <Tabs queryString="mount-storage-via-nfsv4">
      <TabItem value="nfsv4-linux" default>
        <TabItemLabel>
          Linux
        </TabItemLabel>

        1. [Connect to the cloud server](/cloud-servers/manage/connect-to-server.mdx).

        2. Open the CLI.

        3. Install the package for working with the NFS protocol:

           ```bash
           sudo apt install nfs-common
           ```

        4. Create folders for mounting storages:

           ```bash
           sudo mkdir -p /mnt/nfs_source
           sudo mkdir -p /mnt/nfs_target
           ```

        5. Mount the file storages:

           ```bash
           sudo mount -vt nfs "<filestorage_source_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfs_source
           sudo mount -vt nfs "<filestorage_target_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfs_target
           ```

           Specify:

           * `<filestorage_source_ip_address>` — IP address of the source file storage. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Settings** tab → **IP**;
           * `<filestorage_target_ip_address>` — IP address of the target file storage. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Settings** tab → **IP**;
           * `<mountpoint_uuid>` — mount point ID. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Connection** block → **GNU/Linux**.

        6. Transfer data between storages:

           ```bash
           rsync -avzhHl --progress /mnt/nfs_source/ /mnt/nfs_target/
           ```
      </TabItem>

      <TabItem value="nfsv4-windows">
        <TabItemLabel>
          Windows
        </TabItemLabel>

        To work with file storage from Windows, we recommend using file storage with the CIFS protocol. If you need to connect storage with the NFSv4 protocol, install and use a client that supports this protocol, and then mount the file storage. To mount the file storage, refer to the documentation of the chosen client.

        File Storage works only with the NFSv4 version of the NFS client. By default, Windows OS supports NFS clients of versions NFSv2 and NFSv3. For more information about NFS versions, see the [NFS Overview](https://learn.microsoft.com/ru-ru/windows-server/storage/nfs/nfs-overview) article in the Microsoft documentation.
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem value="server-cifssmbv3">
    <TabItemLabel>
      CIFS SMBv3
    </TabItemLabel>

    <Tabs queryString="mount-storage-via-cifssmbv3">
      <TabItem value="cifssmbv3-linux" default>
        <TabItemLabel>
          Linux
        </TabItemLabel>

        1. [Connect to the cloud server](/cloud-servers/manage/connect-to-server.mdx).

        2. Install the package for working with the CIFS protocol:

           ```bash
           sudo apt install cifs-utils
           ```

        3. Create folders for mounting storages:

           ```bash
           sudo mkdir -p /mnt/cifs_source
           sudo mkdir -p /mnt/cifs_target
           ```

        4. Mount the file storages:

           ```bash
           sudo mount.cifs -o guest "<filestorage_source_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/cifs_source
           sudo mount.cifs -o guest "<filestorage_target_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/cifs_target
           ```

           Specify:

           * `<filestorage_source_ip_address>` — IP address of the source file storage. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Settings** tab → **IP**;
           * `<filestorage_target_ip_address>` — IP address of the target file storage. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Settings** tab → **IP**;
           * `<mountpoint_uuid>` — mount point ID. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Connection** block → **GNU/Linux**.

        5. Transfer data between storages:

           ```bash
           rsync -avzhHl --progress /mnt/cifs_source/ /mnt/cifs_target/
           ```
      </TabItem>

      <TabItem value="cifssmbv3-windows">
        <TabItemLabel>
          Windows
        </TabItemLabel>

        1. [Connect to the cloud server](/cloud-servers/manage/connect-to-server.mdx).

        2. Open the CLI.

        3. Mount the file storage:

           ```bash
           net use X: \\\\<filestorage_source_ip_address>\share-<mountpoint_uuid>
           net use Y: \\\\<filestorage_target_ip_address>\share-<mountpoint_uuid>
           ```

           Specify:

           * `<filestorage_source_ip_address>` — IP address of the source file storage. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Settings** tab → **IP**;
           * `<filestorage_target_ip_address>` — IP address of the target file storage. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Settings** tab → **IP**;
           * `<mountpoint_uuid>` — mount point ID. You can view this in the [control panel](https://my.selectel.ru/vpc/default/file-storage/): in the top menu click **Products** → **File Storage** → storage page → **Connection** block → **Windows**.

        4. Transfer data between storages:

           ```bash
           robocopy "X:\" "Y:\" /MIR /Z /FFT /R:3 /W:10 /COPY:DAT /MT:8 /V /NP /LOG:robocopy.log
           ```
      </TabItem>
    </Tabs>
  </TabItem>
</Tabs>

<Formbricks />
