Given the following scenario, you’ve just launched a new WordPress site by pointing DNS to the new server and you need to grab a backup file from the old web server. What do you do? There are many potential solutions, such as:
- Revert DNS
- Modify the local HOSTS file so that you can reach the old website.
- Dig around for the old hosting login info, assuming that’s something you even had in the first place.
There is a better method that involves the command line. With
wget you can directly download data from the old server by specifying a custom IP and host header.
wget http://18.104.22.168/backup-sitename-2020_01_17.zip --header "Host: sitename.com"
This is exceptionally useful when fetching large files directly to the new web server. That skips the hassle in downloading and uploading between servers. Having servers talk directly to servers is always recommended. 👌