HostOnNet Blog

How to move site files using lftp

Looking for Linux Server Admin or WordPress Expert? We can help.


lftp is a command line ftp client, that can be used to upload files and folders. Default ftp command available on linux systems can only upload files from same directory, can’t handle sub folders.

Lets say, we need to upload content of site “” to new server –

In SSH, change to the site folder.

cd /home/domains/

Lets connect to remote server with lftp


We have to change to wwwroot folder.


To make sure you are in correct folder, use ls or dir command to list content of directory.

If we are in correct folder (wwwroot), then we can run command mirror -R to upload content of current directory to remote directory. Mirror means download, with -R open, we are reverse mirroring, that is upload.

mirror -R

Again, verify files are uploaded with ls or dir command.

Disconnect from remote FTP server with command


You should make sure you are in correct local and remote directory before mirroring.

Here is example of moving web site

cd /home/domains/
lftp -d -u
rm default.aspx 
mirror -R

Posted in CentOS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.