# Move Files

### Description

The `Move files` action moves a number of files and/or folders to alternate locations on your file system.

This also works on remote file systems via [VFS](/data-shaper-1.21/knowing-the-data-shaper-designer/apache-hop-virtual-file-system.md), e.g. with FTP.

Example for a move (rename) of a file on a FTP server (username/password must be given for source and destination).

* File source: ftp\://username:password\@ftpserver/dir/testfile\_partly.txt
* File destination: ftp\://username:password\@ftpserver/dir/testfile.txt
* Check "Destination is a file" in the "Destination File" tab.

### Options

#### General Tab

| Option                        | Description                                                                                       |
| ----------------------------- | ------------------------------------------------------------------------------------------------- |
| Action name                   | The name of the workflow action.                                                                  |
| Settings                      |                                                                                                   |
| Include Subfolders            | Also move the content of sub-folders                                                              |
| Move empty folders            | Also move empty folders                                                                           |
| Simulate                      | Don’t actually move anything, just see if it’s possible at all.                                   |
| Copy previous results to args | Use the result files from the previous workflow action (actions) as files and/or folders to move. |
| Files / Folders               | You can specify the list of files or folders with destinations and wildcards in this grid.        |

After specifying a folder and wildcard (regular expression), use the `Add` button to add your file/folder selection to the table. Use the `Delete` or `Edit` buttons to remove or edit selected lines in the table.

#### Destination File Tab

In this tab you can specify the destination of the files and/or folders and their new filenames.

| Option                               | Description                                                                                                                                                                                                                                                                      |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Destination file                     |                                                                                                                                                                                                                                                                                  |
| Create destination folder            | Use this option to create the destination folder                                                                                                                                                                                                                                 |
| Destination is a file                | Check this option if you want to move files                                                                                                                                                                                                                                      |
| Do not keep folder structure         | flatten the sub-folder structure if any sub-folders are used                                                                                                                                                                                                                     |
| Add date to destination filename     | Add a date to the destination filename (yyyyMMdd or 20091231)                                                                                                                                                                                                                    |
| Add time to destination filename     | Add a time to the destination filename (HHmmss or 235959)                                                                                                                                                                                                                        |
| Specify date time format             | Allows you to specify your own date-time format. The default is yyyyMMdd'\_'HHmmss                                                                                                                                                                                               |
| Add date before extension            | Add the data part before the file extension.                                                                                                                                                                                                                                     |
| If destination file exists           | <p>Select one of these options:</p><ul><li>Do nothing</li><li>Overwrite destination file</li><li>Create file with unique name</li><li>Delete source file</li><li>Move source file to folder : use the lower part of the dialog (next option in this grid)</li><li>Fail</li></ul> |
| Move to folder                       |                                                                                                                                                                                                                                                                                  |
| Destination folder                   | The target folder to move to                                                                                                                                                                                                                                                     |
| Create folder                        |                                                                                                                                                                                                                                                                                  |
| Add date                             |                                                                                                                                                                                                                                                                                  |
| Add time                             |                                                                                                                                                                                                                                                                                  |
| Specify format                       | Allows you to specify your own date-time format. The default is yyyyMMdd'\_'HHmmss                                                                                                                                                                                               |
| If file exists in destination folder | <p>Select one of these options:</p><ul><li>Do nothing</li><li>Overwrite file</li><li>Unique name</li><li>Fail</li></ul>                                                                                                                                                          |

#### Advanced Tab

| Option                | Description                                                                                                                                                                                                                                                                              |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success on            |                                                                                                                                                                                                                                                                                          |
| Success condition     | <p>Select one of these option:</p><ul><li>Success when all works fine (default)</li><li>Success when at least x files moved (specify x in the limit field below)</li><li>Success when number of errors lesser than (specify the max number of errors in the limit field below)</li></ul> |
| Nr errors lesser than | The number of files moved or the number of errors, depending on the success option above                                                                                                                                                                                                 |
| Result files name     | Add files to result files name                                                                                                                                                                                                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/workflows/actions/movefiles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
