---
schema_version: "1"
id: b29f5a232bab25b9c9e3c0e0194f557e58ef09ad5e54e31b962530c705a16038
title: Copy and Move Files with the SFTP Connector Example
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/sftp-connector/2.5/sftp-copy-move.md
canonical_url: https://docs.mulesoft.com/sftp-connector/2.5/sftp-copy-move
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1c72680f72223d8ba9442b9f58c626ba76f56893d70734591e1d215b402dcc96
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
---
product: SFTP Connector
version: 2.5
---

# Copy and Move Files with the SFTP Connector Example

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Anypoint Connector for SFTP (SFTP Connector) **Copy** and **Move** operations enable you to copy and
move files or directories on demand.

While SFTP has a native concept of copying and moving, FTP does not. FTP Connector simulates these
operations by downloading file content and writing it to a new location, using concurrent streams
that start writing and reading at the same time. Because these operations create significant network
overhead, use them wisely. Note that the SFTP Connector **Move** operation does not impact network
overhead.

## Configure the Copy Operation in Studio

To add and configure the **Copy** operation in Studio, follow these steps:

1.  In the **Mule Palette** view, search for `sftp` and select the **Copy** operation.

2.  Drag the **Copy** operation onto the Studio canvas.

3.  In the **General** tab of the operation configuration screen, click the plus sign (**+**) next
    to the **Connector configuration** field to access the global element configuration fields.

4.  Specify the connection information and click **OK**.

5.  Set the **Source path** field to the path of the file to copy, for example, `source.txt`.

6.  In the **Target path** field, enter the directory path into which to copy the file, for example,
    `backup`.

7.  Set the **Rename to** field to rename the file as part of the operation, for example,
    `renamed.txt`.  
    This field must be a filename, not a path. If this attribute is not provided, the original
    filename is used.

![Copy operation configuration in Studio](/mulesoft/current/en-us/sftp-connector/2.5/_images/sftp-copy-operation.png)

In the **Configuration XML** editor, the `<sftp:copy>` configuration looks like this:

```xml
<sftp:copy sourcePath="source.txt"
  targetPath="backup" overwrite="true|false"
  createParentDirectories="true|false"
  renameTo="renamed.txt"/>
```

## Configure the Move Operation in Studio

To add and configure the **Move** operation in Studio, follow these steps:

1.  In the **Mule Palette** view, search for `sftp` and select the **Move** operation.

2.  Drag the **Move** operation onto the Studio canvas.

3.  In the **General** tab of the operation configuration screen, click the plus sign (**+**) next
    to the **Connector configuration** field to access the global element configuration fields.

4.  Specify the connection information and click **OK**.

5.  Set the **Source path** field to the path of the file to move, for example, `source.txt`.

6.  In the **Target path** field, enter the directory path into which to move the file, for example
    `backup`.

7.  Set the **Rename to** field to rename the file as part of the operation, for example,
    `renamed.txt`.  
    This field must be a filename, not a path. If this attribute is not provided, the original
    filename is used.

![Move operation configuration in Studio](/mulesoft/current/en-us/sftp-connector/2.5/_images/sftp-move-operation.png)

In the **Configuration XML** editor, the `<sftp:move>` configuration looks like this:

```xml
<sftp:move sourcePath="source.txt"
  targetPath="backup"  overwrite="true|false"
  createParentDirectories="true|false"
  renameTo="renamed.txt"/>
```

## See Also

- [SFTP Connector Examples](https://docs.mulesoft.com/sftp-connector/2.5/sftp-examples)

- [Salesforce Help](https://help.salesforce.com)
