# Move task

A Move takes each file on the list to another place and removes it from where it was. It is the [Copy](Task-Copy.md) task in its second form: the same fields, one difference in what happens at the end.

A Move is not in the task picker. Add a **Copy** and press **Convert to Move Task** at the top of its form; **Convert to Copy Task** turns it back.

## How it moves

| Source and destination are | The Move |
|---|---|
| on the same server, reached the same way | renames the file into its new place. Nothing is transferred: a file of any size moves at once. In the log: "Attempting rename move". |
| in different places | copies the file, and deletes the original when the copy is complete: "Do a copy source to destination, then a delete source." |

A file is never deleted before its copy is complete. If the delete then fails, the task fails with "Move/delete failed to delete the file!", and the file is in both places.

## Fields

All fields of the [Copy](Task-Copy.md#fields) task, with these differences:

| Field | In a Move |
|---|---|
| **Destination** | where each file goes, ending in a file name: `file:///data/done/{name}` |
| **Retry failed moves x times** | the Copy's retries, under this name |
| **Move Unique** | the Copy's **Copy Unique**: when a file of that name is there, a free name is found |
| **Rename source after copy** | has no use: the source is gone |
| **After copying, add to list for future tasks.** | not used: the list holds the moved files in any case |

A source folder that is empty after its files were moved is deleted too.

## What it hands on

The items **at their new place**: `{url}`, `{name}` and `{path}` are those of the destination. A task behind a Move works on the files where they are now.

That is the main difference from a Copy in a job: after a Copy the list still points at the source, after a Move at the destination.

## Things to know

- **The folder must exist**, as for a Copy: put a [MakeDirectory](Task-MakeDirectory.md) before it.
- **Move, or Copy and Delete?** A Move deletes each original right after its own copy. A Copy followed by a [Delete](Task-Delete.md) deletes nothing until every file was copied: when a batch must arrive whole or not at all, use the two tasks.
- **"Archive after processing"** is a Move at the end of a job, to a folder named by date: `file:///data/archive/{yyyy}/{MM}/{name}`.
- **Between two folders of one remote server**, a Move is a rename on that server and costs no transfer. That is the cheap way to mark a partner's file as taken, where you may write there: move it to a `done` folder.
