Move File Using File System Task in SSIS

In this article, we show you how to Move Directory Using File System Task in SSIS from one location to another location with example. To delete the complete Directory, Please refer to Delete Directory Using File System Task article in the SSIS page.

TIP: Please use the Foreach Container to move multiple files from one location to another location. You can refer to Move Multiple files using File System Task for the practical example.

We have File System Task Folder inside the MSBI Folder. The below screenshot shows you the data inside that folder. Our SSIS task is to move the CUSTOMERS.txt file inside the File System Task Folder to Copied Folder inside F Drive.

Move File Using File System Task in SSIS 0

Files inside the Copied folder are:

Move File Using File System Task in SSIS 1

Move File Using File System Task in SSIS

To move file using file system task in ssis, Please Drag and drop the File System Task into the Control Flow region and rename it as Move File Using File System Task in SSIS

Move File Using File System Task in SSIS 2

Double click on it will open the File System Task Editor to configure it.

In this example, We are Moving a single file. So, please change the operation property to Move File as shown in the below screenshot

Move File Using File System Task in SSIS 3

Let us configure the Source Connection by selecting the SourceConnection property. If you already created the File Connection Manager, select the created one. Or If you saved the Source Connection in a Variable, please change the IsSourcePathVariable property to TRUE and select the Variable Name.

Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.

Move File Using File System Task in SSIS 4

Once you click on the <New Connection..> option, File Connection Manager Editor will open to configure it. Here, we are Moving the existing file, so select the Existing File option from the Usage Type.

Click on the Browse button to select the Existing File from the file system.

Move File Using File System Task in SSIS 5

From the above screenshot, you can see we selected the CUSTOMERS.tx file inside the File System Task Folder

Move File Using SSIS File System Task 1

Click Ok to finish configuring the Source connection.

Now we have to configure the Destination Connection so, Please select the DestinationConnection property. If you already created the File Connection Manager before then select the created one or If you stored the Destination Connection in the Variable then, please change the IsDestinationPathVariable property to TRUE and select the Variable Name.

Here, We haven’t created any connection Manager before. So, we are selecting <New Connection..>.

Move File Using SSIS File System Task 2

In this example, we are Moving the existing file to an already existing folder. So, select the Existing Folder option from the Usage Type.

Move File Using SSIS File System Task 3

Click on the Browse button to select the Existing Folder from the file system.

Move File Using SSIS File System Task 4

As you see, we selected the Copied Folder as the destination folder. Click the Ok button to select it.

Move File Using SSIS File System Task 5

Next, Click Ok to complete configuring the File Connection Manager for the destination.

Move File Using File System Task in SSIS 10

Click Ok to finish configuring Move File using File System Task in SSIS package. Let’s run and see whether we successfully Moved the Customers.txt file using the File System Task or Not.

Move File Using File System Task in SSIS 11

Well, We successfully Moved the Customers.txt file present in the File System Task Folder to the Copied Folder.

Move File Using File System Task in SSIS 12

Comments are closed.