The fastest (easiest) way to move files from server-to-server.
- Useful for big files.
- Or if you have slow connection.
- You will need SSH/CLI access into the server receiving the file.
Yes, this way is a little more technical and requires the command line…but it’s so much faster than downloading and uploading the file. (Waste of time and slow.)
Just as comparison…wget can transfer a 20gb file from opposite ends of the world within minutes. Try doing that with FTP (downloading to your local computer, and uploading to far away server) and see how long that takes.
Steps to using WGET:
1. Make file publicly available on source server
- Which means placing somewhere within
public_html
(RHEL/Centos) orwww
(Debian/Ubuntu). - Placing it in a public directory makes it available from frontend url (e.g.
https://domain.com/backup.tar.gz
).
2. Download file from destination server.
- From receiving server, navigate to the directory you’d like to download it to.
- Type
wget https://domain.com/backup.tar.gz
– to download external file to your current directory. - (Of course, your file path and filename may vary.)
- Wait for it to finish transferring. Should be super quick.
3. Change file ownership to match correct USER:GROUP.
- Type
ls -la
to see what what other files are owned by. You’ll probably see other files listed asjimbob:jimbob
orjimbob:nobody
, while the one you just downloaded was probablyroot:root
(or whatever linux sudo user you had). - Type
chown YOURuser:YOURgroup backup.tar.gz
– using the correct user, group, and filename. - Don’t forget to do this. Otherwise, you won’t be able to extra the archive later!
Other WGET tips and tricks
- You can use
wget 123.123.123.123/wp-content/backup.tar.gz --header "Host: domain.com
– nice little trick to download specifically from a certain IP. Useful during DNS changes that haven’t propagated. - If you’re unable to compress files on the source server, you’ll need to use
rsync
command instead. Rsync guide #1, guide #2. - Sometimes the source server (especially on crappy webhosts) are so slow and even disconnect before you download the whole file. You can try rate-limiting your wget.
- Other useful wget commands – guide #1, guide #2.
Leave a Reply