Enter your keyword

post

Copy files from one SFTP to another in OIC

There are scenarios where we want to copy files from one SFTP location to another in Oracle Integration Cloud.

In this article, I will show you how to copy files from one SFTP to another irrespective of the type of files.

Let’s see how to achieve this.

  • Create a scheduler integration
  • Drop the source FTP adapter and enter the name of the endpoint(ListFiles)

FTP Adapter in OIC

  • Configure properties as below and click on the Next button
    • Select Operation: List File
    • Input Directory: Enter the directory from which files to be listed
    • File Name Pattern: *

FTP adapter in OIC

  • Complete the wizard
  • Drop For-Each activity just below the FTP adapter and configure properties as below
    • Name: LoopOverTheFiles
    • Repeating Element: Drop the repeated element of ListFile Response
    • Current Element Name: CurrentFile

For loop in OIC

  • Drop the same source FTP adapter(under For each), enter the name of endpoint(ReadFile) and click the Next button

FTP adapter in OIC

  • Configure properties as below and click on the Next button
    • Select Operation: Read File
    • Input Directory: Enter the directory from where the files to be read
    • File Name Pattern: abc.tmp

FTP adapter in OIC

  • Select No radio button from Do you want to define the schema for this endpoint? and click the Next button

FTP adapter in OIC

  • Complete the wizard
  • Edit the ReadFile mapper and do the mapping as below:
    • CurrentFile/File/directory ——>  SyncReadFile/FileReadRequest/directory
    • CurrentFile/File/filename  ——>  SyncReadFile/FileReadRequest/filename

Mapper in OIC

  • Drop target FTP adapter, enter the name of endpoint(TargetFTP) and click the Next button

FTP adapter in OIC

  • Configure properties as below and click on the Next button
    • Select Operation: Write File
    • Specify an Onput Directory: Enter the directory where the file to be written
    • File Name Pattern: abc.tmp

Write File in OIC

  • Select No radio button from Do you want to specify the structure for the contents of the file nd click the Next button

FTP adapter in OIC

  • Edit the TargetFTP mapper and map below fields:
    • ReadFile/SynchReadFileResponse/FileReadRespons/FTPResponseHeader->filename —> WriteFile/OutboundFTPHeaderType/filename
    • ReadFile/SynchReadFileResponse/FileReadResponse/ICSFile/FileReference —> WriteFile/ICSFile/FileReference
    • ReadFile/SynchReadFileResponse/FileReadResponse/ICSFile/Properties/filetype —> WriteFile/ICSFile/Properties/filetype
    • ReadFile-/SynchReadFileResponse/FileReadResponse/ICSFile/Properties/filename—> WriteFile/ICSFile/Properties/filename

Mapper in OIC

  • All the required configurtion is completed. Let’ move ahead and test the integration.
  • Below are the files on my source FTP and after the integration is executed, all these files will be copied to another FTP.
  • Submit the integration and see all files from source FTP should be copied to target FTP

Look at my YouTube channel for OIC related video and Subscribe to YouTube channel to get the latest updates.

Leave a Reply

Your email address will not be published.