Move Directory Using File System Task in SSIS

In this article, we will 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.

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

Move Directory Using FIle System Task in SSIS

Files inside the Copied folder are:

Move Directory Using FIle System Task in SSIS

Move Directory Using File System Task in SSIS

Drag and drop the File System Task into the Control Flow region and rename it as Move Directory Using File System Task in SSIS

Move Directory Using FIle System Task in SSIS 1

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

In this example, we are Moving directory. So, Please change the operation property to Move Directory

Move Directory Using FIle System Task in SSIS 2

Select the SourceConnection property to configure the source. If you already created the File Connection Manager, select the created one. Or If you stored 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 Directory Using FIle System Task in SSIS 3

Once you click on the <New Connection..>, File Connection Manager Editor will be opened to configure it. In this example, we are Moving the existing directory. So we are selecting Existing Folder option from the Usage Type 

Move Directory Using FIle System Task in SSIS 4

Click on the Browse button to select the Existing Folder.

Move Directory Using FIle System Task in SSIS 5

As you can see, we selected the SSIS BLOGGER pics folder inside the File System Task Folder

Move Directory Using FIle System Task in SSIS 6

Now, we have to configure the Destination Connection. So, Please select the DestinationConnection property. If you previously created the File Connection Manager, select the same. Or If you put the Destination Connection in a Variable, change the IsDestinationPathVariable property to TRUE and pick the Variable Name.

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

Move Directory Using FIle System Task in SSIS 7

From the above screenshot, you can see that we created a New folder called SSIS BLOGGER pics folder inside the Copied Folder by clicking the Make New Folder button.

Move Directory Using FIle System Task in SSIS 8

Click Ok to finish configuring the File Connection Manager for the destination.

Move Directory Using FIle System Task in SSIS 9

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

Move Directory Using FIle System Task in SSIS 10

Well, We successfully Moved the SSIS blogger pics directory present in the File System Task Folder to the Copied Folder Directory.

Move Directory Using FIle System Task in SSIS 11

If you observe the source connection again (MSBI Folder), the SSIS blogger pics folder is not present because we are moving the directory, not copying it.

Move Directory Using FIle System Task in SSIS 12