In a previous post, we taught you how to mirror an FTP/S service running on JSCAPE MFT Server to an Amazon S3 bucket folder. You can set up a similar process using any remote FTP/S service even if that service isn't running on a JSCAPE MFT Server instance. We'll show you how to do that in this post.
Watch the video
Would you prefer to watch a video version of this tutorial instead? You can play the video below. Otherwise, just skip it if you wish to continue reading.
Note that what we'll be setting up in this post is a synchronization. Unlike mirroring, which is what we took up last time, synchronization is a two way process wherein new and modified files from both directories are copied onto both paths. Mirroring is normally just one way, i.e., new and modified files are copied from source to target and redundant files in the target are deleted.
Also, just to be clear,the remote FTP server we want to synchronize with S3 this time is on a separate machine. It's no longer running on the same machine as JSCAPE MFT Server. In fact, it could be in another geographical location. All we need to do to synchronize that remote FTP Server to Amazon S3 is to create a trading partner for it and then set up synchronization using a trigger with the trading partner synchronization action.
We'll also need a trading partner for Amazon S3 but we already set one up last time, so let's just use that. Ready to proceed?
Start by adding a new trading partner.
When the trading partner protocol dialog appears, expand the drop down list and select the FTP mode that matches the one you're using on your remote FTP server. In my case, I'm selecting FTPS explicit.
When the trading partner parameters dialog appears, start by giving this trading partner a name, e.g. 'tp-ftp'.
Next, enter the IP address or hostname of that remote FTPS server. In my case, that would be 172.31.12.181.
Lastly, enter the login credentials of an existing user account on that remote FTP server.
If you want, you may click the Test Server button to test your connection.
If the test succeeds, click OK.
You should then see your newly created trading partner among your list of trading partners. As you can see, we already have an Amazon S3 trading partner. That's the trading partner this FTPs trading partner will be synching with. But if you don't know how to create one yet, I suggest you read the post How To Mirror an FTP/S folder to S3.
The last step is to create the trigger that would automatically synchronize that FTP trading partner with the Amazon S3 trading partner. To do that, just go to the Triggers module and click the Add button.
For those who are using JSCAPE MFT Server version 12.1 and higher, you'll be presented with a Trigger Template dialog where you can choose a template that best describes the workflow you're about to automate. Let's just leave that blank for now and click OK.
Give this trigger a name, e.g. 'sync remote FTP with s3'.
After that, specify an event that would initiate this mirroring process. We just want this trigger to execute at a particular schedule, so let's choose the Current Time event type.
In the next screen, you can use the Expression Builder to build an expression that would define the schedule when this particular trigger should fire. I want this trigger to execute at 12:45 PM everyday, so I built the expression as shown on the screen.
Recommended read: Introducing the New Trigger Conditions Expression Builder
When you get to the next screen, click the Add button to add a new trigger action. This is the part of the trigger creation process where you would specify how the synchronization should be carried out.
Select the Trading Partner Synchronization action from the drop-down list and then click OK.
Let me now walk you through the key settings for this Trading Partner Synchronization action.
The first ones you'll encounter are PartnerA and PartnerB. In the previous post, we defined PartnerA as the source. But because this is a synchronization process, which, as we explained earlier, is a two-way process, the concept of a source and target is irrelevant.
Anyway, let's just select our FTP trading partner for PartnerA and our Amazon S3 trading partner for PartnerB.
Next up are PathA and PathB. PathA is the relative path in PartnerA that will be involved in the synchronization process and PathB is the relative path on PartnerB that PathA will be synchronizing with. Of course, those paths should already exist in the respective trading partners.
The next setting we need to specify is the Copy Condition. This is the condition JSCAPE MFT Server will use to determine whether to commence copying (or synchronizing) files each time the predefined schedule of this trigger is up.
If you select:
- different time, JSCAPE MFT Server will commence copying if it sees that file timestamps on A are different from the ones on B;
- different size, JSCAPE MFT Server will commence copying if it sees that file sizes on A are different from the ones on B;
- different content, JSCAPE MFT Server will commence copying if it sees that the content in A is different from the content in B
Let's just choose different time for now.
Another setting you need to specify is the Synchronization Mode. There are four options:
- mirror - New and modified files from A are copied to B; redundant files in B will be deleted;
- synchronize - New and modified files from both paths are copied to each other
- backup - All files from A are copied to B
- contribute - New and modified files from A are copied to B
As you might have guessed, we'll be using synchronize for this example.
Lastly, you need to specify the Result Directory. This is where the results of the synchronization process will be written to.
Click OK and then drag an arrow from the Start output of the Workflow node to the Trading Partner Synchronization Action node.
Recommended read: Introducing the Redesigned Trigger Action Workflow
Click OK to finalize the trigger creation process.
That's it. Now you know how to configure JSCAPE MFT Server so that you can synchronize a remote FTP/S folder to an Amazon S3 bucket folder.
Try this yourself
Would you like to try this yourself? Download the FREE, fully-functional Starter Edition of JSCAPE MFT Server now.