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.
Files inside the Copied folder are:
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
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
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..>.
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
Click on the Browse button to select the Existing Folder.
As you can see, we selected the SSIS BLOGGER pics folder inside the File System Task Folder
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..>.
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.
Click Ok to finish configuring the File Connection Manager for the destination.
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.
Well, We successfully Moved the SSIS blogger pics directory present in the File System Task Folder to the Copied Folder Directory.
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.