Note: apt-get update is a necessary command because if you don’t run this command then it may give out some error such as - AzCopy will not work properly.
Step 2: Go to storage account then Files
Step 3: Go to file then to file share
Step 4: Now click on the file share. Then give the name and size of the block you want to store data from one server (Source) to this file share and then again to another server (destination) where you want that data to be copied. Click on ‘create’ to create file share.
Step 5: Run the following set of commands on the server one (Source). So, data or files will get copied from server one to file share. In destination, you need to give the URL of your file share as given below in the picture. In dest-key you have to give the private key of your storage account. The source will be your location of the file which you need to transfer to file share.
When you will run this command, you will see the following output.
Commands:
azcopy \
--source /opt/sampledata \
--destination https://xxxxxx.xxxx.core.windows.net/hello \
--dest-key Cdj7eg4waG3tfyu6RSJhoFFd5pCSrLQj1urt/kpvCPE4PJ3o7yAOhh11Ma8dR7xxIlzeGR6vF0kjyIiCw
== \
--recursive
Step 6: Run the following set of commands on another server (destination). So, data or files will get copied from file share to destination server. In the source, you need to give a URL of your file share as given below in picture, in source-key you have to give the private key of your storage account. In the source, you need to give the URL of your file share. And destination will be the path you want the file to be copied to.
Commands:
azcopy \
--source https://xxxxx.xxxxx.core.windows.net/hello \
--destination /opt/sampledata \
--source-key
Cdj7eg4waG3tfyuLoFFd5pCSrLQj1urt/kpvCPE4PJ3o7yAOhh11Ma8dR7xxIlzeGR6vF0kjyIiCw== \
--recursive
Step 7: We have successfully copied the data from one server to another. Therefore, AzCopy is a very useful tool. This is safe but sometimes we have to keep in mind that it does not copy files with the same name. We have to be careful about that. As you can see in the screenshot, first sample data was not there and later it was present in another server (destination).