0

I have a website that I'm trying to migrate from Bluehost to SiteGround.

I compressed the website into a zip file, i created the SSH access within SiteGround and i'm successfully connected to it, when i try to transfer remotely the zip file located on bluehost i get an error saying: "Could not resolve hostname ssh..."

Usually for transferring files i use the same methods with other hosts, only this time it doesn't not work between Bluehost -> SiteGround

This is the command line i'm using:

cp -r https://oldhost.com/myfile.zip / scp -r https://oldhost.com/myfile.zip /

Does anybody have an idea why this is not working? Any help would be much appreciated.

Thank you

marouane91
  • 13
  • 2

1 Answers1

0

You don't run cp and scp together like that.

Assuming you are currently logged into the NEW server when you run the command, I would probably run something like this:

scp -r user@oldhost.com:/path/to/myfile.zip /path/to/new-server/location.
Note that you can change the oldhost.com to an IP address if the DNS cannot resolve.

David W
  • 3,453
  • 5
  • 36
  • 62
  • Thank you for your help. What shall i put instead of "user", should i leave it as it is? Or put something instead? – marouane91 Dec 02 '20 at 13:10
  • Replace `user` with your own username. Use your own credentials to access the remote server. – David W Dec 03 '20 at 00:29
  • I'm on SiteGround SSH, when i run the command: "scp -r cpanelusernameoldhost@oldhost.com:/path/to/myfile.zip /path/to/new-server/location" i get the following error: "Permission denied (publickey)" why is that? – marouane91 Dec 03 '20 at 08:41
  • Have you added your new server's public ssh key to your user's `authorized_hosts` file on the old server? – David W Dec 03 '20 at 10:56
  • OMG, i have not. So that's why it was not working. Thank you so much David ! – marouane91 Dec 07 '20 at 16:39