Copying files using SSH.

As an Internet agency, we also handle relocations and migrations of websites, portals and applications. In some cases, this can already mean several GB of data.

The most effective way to copy data from one system to another is via SSH. Of course, the prerequisite for this is that both hosting packages offer SSH access.

One way to copy files between two servers is with SCP.

To copy the data from your local server to a remote server #

Log in via SSH to the server from which you want to copy the data.

Then enter the following line in the console:

scp -r /pfad/zum/lokalen/verzeichnis dein_benutzername@zielserver.de:/pfad/zum/remote/verzeichnis

After entering your password, the copying process should already start.

To copy the data from a remote server to your local server #

Log in via SSH to the server where you want to insert the data.

Then enter the following line in the console:

scp -r dein_benutzername@zielserver.de:/pfad/zum/remote/verzeichnis /pfad/zum/lokalen/verzeichnis

After entering your password, the copying process will begin.

Run SCP in the background #

If you don’t want to watch the process permanently, you can move it to the background.

Press CTRL+Z to pause copying. Afterwards you can use bg to restart the process in the background without having to stay there. With exit you can close the terminal.

  1. CTRL+Z to pause the process
  2. bg in the terminal to run the process in the background.
  3. exit to close the terminal.

If SCP is not the right thing for you, you can look at copying files using rsync as an alternative.

Was this article helpful? How do you copy the data when you make a move? Write us a comment. We appreciate your feedback.

Hier klicken, um den Beitrag zu bewerten
[Gesamt: 0 Durchschnitt: 0]

Leave A Comment

Title