Template Best Practices for FTP Import

By Customer Success Managers
January 13, 2017

Use Case

 How do users get content into the CMS?

In cases where it is not practical to create each page individually and where existing data can be obtained in a structured XML or comma-delimited CSV format, CrownPeak WCM offers templates for importing data over FTP (File Transfer Protocol) or SMTP (Simple Mail Transfer Protocol). This Article focuses on FTP.

FTP Import is preferred for large jobs. The process requires creating a remote FTP directory which is "polled" for changes and data is imported and assets are updated/created as needed. FTP Import supports base64 data. FTP Imports are created in ftp_import.aspx Template files.

 

Requirements

  • Existing data in XML or comma-delimited CSV
  • An external FTP Server and log-in credentials
  • CrownPeak Template definitions providing a map from existing content to the new CrownPeak data structure

 

Process

Prepare Your Data

Once you have your data up on an FTP or SFTP server, create a new FTP import connector in System > Configure > Import > FTP. Additional fields are used to specify ftp client configuration and authentication credentials to connect to the external server on which the data file is residing.

 

Create the Import Connector

Note: As of January 2014, Import Connectors can only be configured in the classic UI.

The import connector automatically polls the remote FTP server a certain number of times per day, set under the label "frequency", which can be daily, every six hours, every hour, every 30 mins, every 15 mins, or every 5 mins.

FTP import

The import can also configured to poll the remote service a maximum number of times and to allow a maximum number of files to use the ftp configuration (so that the poll might run until a file is discovered and then not run until the next day). Data files can also be automatically deleted from the remote server or moved after the import is executed.

You can also manually trigger an import poll by selecting Edit > Trigger Import in the CMS.

When the import connector successfully finds a data file in its connection, it will begin the import process in the CMS. The remote file needs to have the correct import TOKEN in it, generally in the remote file name, in order to be recognized by the CMS.

The template referenced in the model that the import connector uses must include an ftp_import.aspx template file which will execute when the import is successful. When executed, this template file will then automatically create or update one or more assets in the CMS.

 

Best Practices

  • Build an input.aspx first to structure / validate your desired CMS fieldname structure.
  • Clearly map out your existing data fields to the CMS asset fieldnames.
  • You can create repeating, nested structures as list panels or as individual assets. Plan how you want this to work based on your needs. e.g., creating separate assets for each item in a collection vs creating the asset itself as a collection and panels as individual items.

 

Common Errors

  • FTP Import Token does not match.
  • ftp_import.aspx import code has the wrong content fields referenced.
  • ftp_import.aspx has the wrong syntax.
  • Incorrect template selected as model. (Make sure to select a sample asset using a template with an ftp_import.aspx)
comments powered by Disqus