Copying files over SSH with rsync

Marc Wagner, July 22, 2022

As a Word­Press agen­cy, we also take over moves of web­sites and Woo­Com­mer­ce stores. This can of cour­se mean seve­ral GB of data that must be moved.

The most effec­ti­ve way to copy data from one sys­tem to ano­ther is via SSH. The pre­re­qui­si­te for this is, of cour­se, that both hos­ting packa­ges offer SSH access.

RSYNC makes it even easier to copy files. The advan­ta­ge of using rsync is that you can deci­de whe­ther files that alre­a­dy exist should be copied again, or whe­ther they can be igno­red.

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

To do this, log in via SSH to the ser­ver from which you want to copy the data. Then enter the fol­lo­wing line in the con­so­le:

rysnc -avz /pfad/zum/lokalen/verzeichnis [email protected]:/pfad/zum/remote/verzeichnis

Now the copy­ing of the data starts direct­ly.

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

Alter­na­tively, you can down­load the data from an exter­nal ser­ver to your cur­rent ser­ver. To do this, sim­ply enter the fol­lo­wing line in the shell on your ser­ver:

rsync -avz [email protected]:/pfad/zum/remote/verzeichnis /pfad/zum/lokalen/verzeichnis

And the data will be down­loa­ded to your local ser­ver.

If rsync is not the right thing for you, you can look at copy­ing files using SCP as an alter­na­ti­ve.

Was this artic­le hel­pful? How do you copy the data when you make a move? Wri­te us a com­ment. We will be glad to recei­ve your feed­back.

Avatar of Marc Wagner
Marc Wagner

Hi Marc here. I'm the founder of Forge12 Interactive and have been passionate about building websites, online stores, applications and SaaS solutions for businesses for over 20 years. Before founding the company, I already worked in publicly listed companies and acquired all kinds of knowledge. Now I want to pass this knowledge on to my customers.

Similar Topics

Comments

Leave A Comment