WARNING: Please note that this article was published a long time ago. The information contained might be outdated.
Recently I needed to migrate a WordPress website from a shared hosting provider to to a virtual private server. More than 4GB of data to transfer to my computer and to re-upload to the new server. So I started looking for a way to do a recursive FTP download directly on the new server.
I first tried to use
wget -N -r --ftp-user=USERNAME --ftp-password=PASSWORD ftp://ftp.example.com/com.example/
wget wasn't able to download all the files, the ones under the
com.example/wp-content/blogs.dir/ (all the subdirectories were there but no files).
So I tried the less common
lftp -u USERNAME,PASSWORD -e 'mirror /com.example/' ftp.example.com
lftpwas able to download everything, also
.htaccessfiles. This is the official
If you get an error like "mirror: Fatal error: Certificate verification: Not trusted", add
set ssl:verify-certificate no
~/.lftp/rc file. Thanks to http://anils-tips.blogspot.it/2011/05/lftp-fatal-error-certificate.html for this tip!