I need to copy specific directories from an Azure data disc (classic) attached to a classic VM to a new data disk attached to a new Linux (Ubuntu) VM. What is the simplest way to move this data (~200GB) from one to the other? The drives are located in different regions. Once the data is copied, the classic resources will be shut down.
Currently, I've attempted to move the data using WINSCP, but of course, that solution is very slow, I've done some research on copying data using AZcopy, but I'm unsure if this is really the simplest solution or if I'm over complicating it by using tools like that.
Transferring Data from Data Disk (Classic) to New Data Disc
To transfer files from one Ubuntu VM
to another VM
, there are multiple ways, but the best approaches are listed below
Method 1: Using SCP
Note: The SCP method should work only if both VMs are able to communicate with each other.
To copy the datadisk files to another VM data Disk.
Nettools
on both the Vms
using below command sudo apt install net-tools
VM1
's data disk to VM2
's data disk. scp -r /data/* Venkat@10.0.0.7:/data
-r: for copy entire directory
/data/* : Path of the VM1
Venkat@10.0.0.7: VM2 username and IP
/data: Path of VM2
```
Result:
Files are copied to VM2
data disk successfully.
Method 2 : AzCopy
Storage account
with container.
3 . Log in to AzCopy
on VM1
to copy the files to the storage account using the command below. azcopy copy "/data/*" "https://vmstoragetestdemo.blob.core.windows.net/vmstorage<Storage account-SAS-Token>" --recursive=true
"/data/*" : path of VM1 Datadisk
Data copied to Storage account from VM1 datadisk
VM2
using the azcopy login
commandVM2
data disk. azcopy copy "https://vmstoragetestdemo.blob.core.windows.net/vmstorage<SAS_TokeN>" "/data" --recursive=true
/data : VM2 Data disk path
Files are copied to VM2
datadisk successfully.
Reference: scp command to copy the files