Tip: How to move whole directory with its content on FTP server

beholder

Avatar: beholder

2008-06-17 15:07

Here is another handy tip for those, who must move BIG directories on an ftp server and don't want to copy all those files from ftp to local machine and then back to ftp.

As an example, perhaps you want to move all content from directory "public_html/img/" to directory "public_html/files/img/"

1. Basically, to move a whole directory along with its contents you must first create a new directory of the same name where you want to have that particular directory moved. So go create a new directory "img" in public_html/files/

2. Then you must go (for example in Total Commander) at least one parent above the directories you want to move or move to: in this case it would be the public_html directory. This is very important, I explain why later.

3. Next write command:

rnfr img


The message from server should be that the directory was found and marked for renaming/moving.

4. Next don't do anything else but write command:

rnto files/img


The message from server should be that the directory was renamed/moved successfully.

Notes:
- you cannot do any other ftp command between step 3 and 4. Not even list, or anything else. Command "rnfr" must be immediately followed by "rnto", otherwise the sequence is broken.
- because of that you must be ABOVE those two directories when doing the moving and use correct paths in the rnfr-rnto commands.
- the original directory that you moved from becomes deleted in this process, its content with all subdirectories is moved to the new directory.
- a tricky thing is to move for example all files from directory "files/" to directory "files/new/" without moving subdirectories in "files/". You would have to use some "helper" directories in the process and do several rnfr-rnto operations. It's possible though.

» Quick.Cart v3.x

QC v3.0

beholder

Avatar: beholder

2010-08-22 12:18

on another server, the directory that you're moving to should not exist before RNTO, so the step 1 should be skipped (directory "img" will be created automatically).

pxl666

Avatar: pxl666

2010-08-25 15:27

cant u just use Cpanel on your server to move files around?
or are talking about moving files from server to server?

beholder

Avatar: beholder

2010-08-26 16:01

I don't know what Cpanel is. I am moving files from one directory on server to another directory on the same server. Without moving them to my computer.

chinesebible

Avatar: chinesebible

2011-09-10 18:30

I have FTP I.d. and password , how to open FTP login in form...

jp

Back to top
about us | contact