Copying files from MyCloud1 to MyCloud2

I have two MyCloud devices and I want to copy data sets from one to the other. I have mapped the relevant shares as drives in Windows 10 and I have previously done this using copy-paste in windows file explorer but it is really slow. Is there a clever and quick way to do this using SSH and putty? An idiots guide would be useful…

If you do not want to use the Safepoint backup feature that is on the WD My Cloud Dashboard you can access the My Cloud via SSH and issue an rsync command. See the following thread for more information:

https://community.wd.com/t/alternative-to-safepoint-reposted/140685

Thanks Bennor. I’m not backing up the data. I’m trying to move it from one MyCloud to the other. Once I am happy it has copied over I will delete the original.
(I already use the safepoint function to create backups on USB connected drives).
I looked at the thread you gave but I didn’t really follow how I could adapt the commands to suit my needs. I’m not too familiar with Linux.

On the MC you want to copy from ssh into the MC. You can then mount a other MC.
mount -t cifs //192.168.10.209/ /

cd to the directory you want to copy from. Then cp -r * /

RAC

Thanks RAC, I think I have the syntax wrong. When I try the mount command above using the correct IP address for my device. After I input the password I get an error “Retrying with upper case share name.
Mount error (6) No such device or address”.

Am I supposed to specify a share name after the IP address/ /

Yes. It is “mount -t cifs //192.168.10.209/sharename /mountpoint” I didn’t notice that it stripped the sharename and mountpoint. It appears that if you use <> around the names they disappear.

RAC

1 Like

You could actually use SCP command from SSH shell:

scp -r root@cloud1_ip:/path/to/folder /destination/on_cloud2/ (considering that you are running this command from cloud2)

-r will copy recursive, i.e. all the folders that are inside the folder you want to copy.

If we assume that you will connect with SSH on cloud2, and you want to copy your “Public” folder from cloud1, you can do the following:

scp -r root@cloud1_ip:/shares/Public /shares/Public (don’t forget the space between first Public and the backslash from the second part)

Thanks Falinka,
Just to clarify, where you have written “@cloud1_ip” I assume this is the ip address for the MyCloud1 device. So, am I correct to use the command
scp -r root@//192.168.x.y:/path/to/folder /destination/on_cloud2/ ??

Yeap, that is correct, if you are running the command from cloud2.

Or, if you want to run it from cloud1, then it would be: scp -r /source/folder root@cloud2_ip:/destination/folder

Regards,

rac8006, when I try the mount -t cifs //192.168.x.y/sharename /mountpoint command, I get asked for a password (but no username). After trying my password I get a “mount error 13 : permission denied”

So, what password is it that I’m being asked for here? Is it the password for the share or is it the SSH access password? I’d expected that I would need to give my user name too…

The root password.

RAC

Hmmm, I’m getting a “mount error 13 : permission denied” error message.

Hey Dubie,

you could get permission denied, as i’m not sure that you actually have place where to mount it. If you are executing this command from cloud2 (new one), you could, first create new folder, let’s say:

  1. mkdir /shares/Public/old_cloud
  2. mount -t cifs //cloud1_ip/Public /shares/Public/old_cloud

Then, to make sure that all is mounted, go to new directory you created:

  1. cd /shares/Public/old_cloud
  2. ls -alh

If mount is successful, you should be able to see the data from the old cloud. Then, you can safely proceed to:

  1. mkdir /shares/Public/new_cloud
  2. cp -r /shares/Public/old_cloud /shares/Public/new_cloud

Few things to consider:

  1. Linux is case sensitive, so Public is with capital P;
  2. I assume you want to copy data from the old cloud from default “Public” folder;
  3. I took example with folder names “old_cloud” and “new_cloud”, you can change them as you see fit (just modify the command examples, if you go that way).

Let us know how it goes :slightly_smiling:

1 Like

Is the Share your trying to mount on MyCloud #2 set to Private? If so set it to Public and try again.

Hi Bennor,

Yeah public access was off for the shares I was copying to/from :grin:
Now that I’ve set it for public, I managed to mount the share and everything is now copying over.

Thanks for the help RAC and Falinka :grinning:

I have successfully copied my data over but now I have some permission issues.
The share I was copying into was originally private so I turned public access on to allow me to SSH into the share and copy data over. After the copying was done I turned public access off because I want this to be a private share. I have checked in the dashboard that I have full access to the share under User and Share control options.
Now when I navigate to the share using windows file explorer I can see the new directories that I copied over, but I cannot access them. I get “the handle is invalid” error message. I have no trouble accessing the pre-existing directories. I have the shares mapped as drives so I tried disconnecting and re-mapping. This didn’t work. When I go back into the dashboard and turn public access back on I can then gain access.

Fixed it myself after a bit of research on the forum.

SSH into MyCloud
cd /shares/share
chown -R UserName.share *
chmod -R 770 share

Everything now working nicely :grinning: