Skip to main content

Move file storage to another project

Last update:

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

  1. Create file storage in the target project.

  2. Create a cloud server in the target project.

  3. Create a global router.

  4. Add the 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 to the subnets of the source project.

  7. Add a static route to the subnets of the target project.

  8. Mount the file stores and migrate the data.

1. Create file storage in the target project

  1. In the Control Panel, on the top menu, click Products and select File Storage.

  2. Click Create Storage.

  3. Enter a name for the repository or leave the name that is automatically created.

  4. Select the region and pool segment where the storage will be created.

    If you need to increase disk space with file storage, select a pool segment from the pool that hosts the cloud server or Managed Kubernetes cluster.

    If you plan to use storage to store backups, we recommend selecting a pool segment from a different availability zone or region to improve fault tolerance.

  5. Fill in the blocks:

  6. Check out the price of file storage.

  7. Click Create.

Subnetwork

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

    • cloud private subnet — the storage will be available to Managed Kubernetes cloud servers and clusters only in the pool you selected when creating the storage. You will only need to mount the storage to connect it;
    • global router subnet — the storage will be available for dedicated servers, as well as cloud servers and Managed Kubernetes clusters that are located in other pools. To connect the storage, you need to configure network connectivity between the server or cluster and the storage through the global router. See the Connect File Storage section for examples of how to configure network connectivity.

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

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

Settings

  1. Select the type of file storage:

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

    Once created, the storage type cannot be changed.

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

  3. Select a protocol:

    • NFSv4 — for connecting storage to servers with Linux-based OS and other Unix systems;
    • CIFS SMBv3 — for connecting the storage to Windows servers.

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

Access rules

  1. Configure the file storage access rules:

    • available to all — the storage will be available to any IP address of the private subnet in which it is created;
    • access restricted — the storage will be available only to specific IP addresses or private subnets. If you create a file storage without rules, access will be restricted to all IP addresses.
  2. If you selected Restricted Access, click Add Rule.

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

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

2. Create a cloud server in the target project

Use the instructions to Create a cloud server.

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

3. Create a global router

  1. In the Control Panel, on 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 name of the router.
  4. Click Create.
  5. If the router is created with the status ERROR or hangs in one of the statuses, create a ticket.

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

Use the Add a port to a subnet instruction.

Specify:

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

5. Connect the networks and subnets of the source and target projects to the router

You need to connect the networks and subnets to the global router up to those cloud platform projects and pools that host the source file storage and the target file storage with the cloud server.

  1. Verify 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 ProductsCloud ServersNetworkPrivate Networks tab → verify that there is no Global Router tag in the network card .

  2. Verify that the subnet meets the conditions:

    • belongs to the RFC 1918 private address range: 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 the router.
  3. In the Dashboard, on the top menu, click Products and select Cloud Servers.

  4. Go to NetworkPrivate Networks tab.

  5. From the menu of the network, select Connect to Global Router.

  6. Select the global router.

  7. For the source project subnet, enter the IP address that will be assigned to the router, or leave the first free address from the subnet assigned by default.Do not assign this address to your devices so as not to disrupt the network.The last two free addresses of the subnet will be reserved as service addresses.

  8. Click Connect. Do not close the window until you see a message that the network is connected.Then in Control Panel:

    • the network will appear under Selectel Global Router on the page of the router to which you connected it;
    • the network will have the Global Router tag. You can look under Cloud ServersNetworkPrivate Networks tab.
  9. Repeat steps 5-8 for the target project subnet.

6. Add a static route to the subnet of the source project

Add a static route from the target project subnet to the source project subnet.Use the Configure Static Routes in Subnets instruction.

Specify:

7. Add a static route to the subnet of the target project

Add a static route from the source project subnet to the destination project subnet.Use the Configure Static Routes in Subnets instruction.

Specify:

  • destination subnet — the 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) — the global router port that you created in step 3.

8. Mount file storages to the cloud server and migrate data

For your information

During the data migration, file storage resources will be completely utilized.We recommend that you suspend work with the storages for the duration of the migration.

  1. Connect to the cloud server.

  2. Open the CLI.

  3. Install the NFS protocol package:

    sudo apt install nfs-common
  4. Create folders to mount the vaults:

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

    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 control panel: in the top menu, click ProductsFile Storage → Storage page → tab Settings → field IP;
    • <filestorage_target_ip_address> — IP address of the target file storage. You can view it in control panel: in the top menu, click ProductsFile Storage → Storage page → tab Settings → field IP;
    • <mountpoint_uuuid> — The ID of the mountpoint. You can look in control panel: in the top menu, click ProductsFile Storage → Storage page → Block Connection → tab GNU/Linux.
  6. Transfer data between storage locations:

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