Copying a website over FTP quickly using SSH terminal.

Earlier this week, I was presented with a challenge to copy over a website that wasn’t having a control panel like cPanel; and moving it over to cPanel web hosting service provided by Extreme Web Technologies.

The traditional approach for such type of migration is to either; archive all the contents if a tool like File Manager exists and lets you do that — or download all the contents first.

Here’s a quick way to copy over all contents recursively – or ‘mirror’ as its called using a handy wget utility.

If you’re using cPanel/WHM – you can go to WHM > Terminal or just SSH into the server you want to copy into; and run the command below:

cd /home/cpanel_user_here
mkdir ftpcopyfolder
wget -m --user="ftp_user_here" --password="ftp_pass_here" ftp://ftp_server_here

It can take a bit of time depending on the data to be copied. Once done, don’t forget to change ownership of these files using the following command:

chown -fR cpanel_user_here:cpanel_user_here /home/cpanel_user_here/ftpcopyfolder

I hope you find this useful.