Skip to main content

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.

  2. Create a cloud server in the target project.

  3. Create a global router.

  4. Add a port for the cloud server to the subnet of the target project.

  5. Connect the network and subnet of the source and target projects to the global router.

  6. Add a static route in the source project subnet.

  7. Add a static route in the target project subnet.

  8. Mount the file storages and transfer the data.

1. Create a file storage in the target project

  1. In the control panel, in the top menu, click Products and select File Storage.

  2. Click Create storage.

  3. Enter a name for the storage or keep the automatically generated one.

  4. Select the location where the storage will be created.

    If you need to increase the disk space of a cloud server or a Managed Kubernetes cluster using file storage, select the location where the server or cluster is located. To increase the disk space of dedicated servers, file storage can be created in any location.

    If you plan to use the storage for backups, we recommend choosing a location different from your primary infrastructure location to increase fault tolerance.

  5. Fill in the sections:

  6. Check the cost of the file storage.

  7. Click Create.

Subnet

  1. Select a private subnet where the storage will be located. The subnet type depends on what you need to connect the storage to:

    • cloud private subnet — storage will be available to cloud servers and Managed Kubernetes clusters only in the pool you selected when creating the storage. To connect the storage, you will only need to mount it;
    • global router subnet — storage will be available to dedicated servers, as well as cloud servers and Managed Kubernetes clusters located in other pools. To connect the storage, you need to configure network connectivity between the server or cluster and the storage via a global router. See network connectivity configuration examples in the instructions of the Connect file storage section.

    Once the storage is created, the subnet cannot be changed.

  2. Enter the private IP address for the storage or leave the first available address from the subnet, which is assigned by default. Once the storage is created, the IP address cannot be changed.

Settings

  1. Select the file storage type:

    • HDD Basic,
    • SSD Universal,
    • SSD Fast.

    Once the storage is created, the storage type cannot be changed.

  2. Specify the storage size: from 50 GB to 50 TB. After creation, you can increase the file storage, but cannot decrease it.

  3. Select a protocol:

    • NFSv4 — for connecting storage to servers running Linux or other Unix-based OS;
    • CIFS SMBv3 — for connecting storage to servers running Windows OS.

    Once the storage is created, the protocol cannot be changed.

Access rules

  1. Configure access rules for the file storage:

    • accessible to everyone — the storage will be available for any IP address in the private subnet where it is created;
    • access restricted — the storage will be available only for specific IP addresses or private subnets. If you create the file storage without rules, access will be restricted for all IP addresses.
  2. If you selected the Restricted access option, click Add rule.

  3. Enter the IP address or CIDR of the private subnet and select the access level.

    After creating the storage, you can configure new access rules.

2. Create a cloud server in the target project

Use the Create a cloud server instructions.

Select the private subnet of the file storage that you created in step 1.

3. Create a global router

  1. In the control panel, in the top menu, click Products and select Global Router.
  2. Click Create router. Each account has a limit of five global routers.
  3. Enter the router name.
  4. Click Create.
  5. If the router was created with the status ERROR or is stuck in one of the statuses, create a ticket.

4. Add a port for the cloud server to the target project subnet

Use the Add port to subnet instructions.

Specify:

  • the file storage subnet of the source project;
  • IP address of the cloud server that you created in step 2.

5. Connect the source and target project networks and subnets to the 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. Make sure that the network has not yet been added to any of the account's global routers. In the control panel, in the top menu, click Products → Cloud Servers → Network → Private networks tab → make sure that the network card does not have the tag Global router.

  2. Verify that the subnet meets the conditions:

    • belongs to the private address range according to RFC 1918: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16;
    • has a size of at least /29, since 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, in the top menu, click Products and select Cloud Servers.

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

  5. From the menu of the network, 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 a message appears stating that the network is connected. After this, in the control panel:

    • the network will appear in the section 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 it in the section 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 a static route from the target project subnet to the source project subnet. Use the Configure static routes in a subnet⁠ instructions.

Specify:

7. Add a static route to the target project subnet

Add a static route from the source project subnet to the target project subnet. Use the Configure static routes in a subnet⁠ instructions.

Specify:

  • destination subnet — subnet of the source project where the source storage is located. You can view it in the control panel: in the top menu, click Products → File Storage → in the file storage line, click the subnet name → Subnets tab → subnet card;
  • gateway (next-hop) — port of the global router that you created in step 3.

8. Mount file storages to the 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.

  1. Connect to the cloud server.

  2. Open the CLI.

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

    sudo apt install nfs-common
  4. Create folders for mounting storages:

    sudo mkdir -p /mnt/nfs_source
    sudo mkdir -p /mnt/nfs_target
  5. Mount the file storages:

    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 it in the control panel: in the top menu, click Products → File Storage → storage page → Settings tab → IP field;
    • <filestorage_target_ip_address> — IP address of the target file storage. You can view it in the control panel: in the top menu, click Products → File Storage → storage page → Settings tab → IP field;
    • <mountpoint_uuid> — mount point ID. You can view it in the control panel: in the top menu, click Products → File Storage → storage page → Connection block → GNU/Linux tab.
  6. Transfer data between storages:

    rsync -avzhHl --progress /mnt/nfs_source/ /mnt/nfs_target/