The Content Search Manager allows you to Search Content, Add/Edit Content, or Import Content by uploading a file. This article shows you how to import content by uploading a CSV (comma delimited), file.
*Importing Related Content- You can also import related content. Please see the Importing Related Content documentation to relate imported content to existing content during the import process.
To import a CSV file, first click on the Content tab to display the Content Search Manager, then click on the "Import Content" link.
Step One: Click on the drop down "Content Type to Import:" menu and choose the Content Type you wish to use for importing content.
Step Two: Click on the "Click here to download a CSV example file" link to preview sample CSV file with the necessary field headings needed by the Content Type, and then populate each column with the *proper data as shown below and save the file in CSV format so that it can be uploaded.
*Warning: Formats for each column heading mut be respected. Date column headings must not only have the proper date formatted content and they must not be left blank or "null". If you are not sure about the formatting of a particular column heading, preview the Content Type prior to importing content.
Step Three: Once the CSV (comma delimited), file is ready for import, the following three fields must be populated to begin the import process:
- Content Type to Import - Choose the Content Type that matches your CSV import file
- Key Fields - When performing imports generated from external systems that have no knowledge of dotCMS identifiers, using keyfields is an alternate way of matching/updating pre-existing content upon import. If a Key Field is selected, all Content with a match in the Key Field will be updated by the record in the CSV file. Moreover, multiple keyfields may be selected to ensure an exact match and update upon import.
To be an eligible Key Field, the field on the content type MUST have the System Indexed property checked so that speedy searches can be made by the importer for matching content.
***Using an Identifier Column instead of Keyfields - An "identifier" column can be added to any csv file for importing content that will search for matching content identifiers already in the system. Contentlets with matching identifiers will be automatically updated by the import. When exporting content to a csv file the identifier column is always included. All Content will be imported as a new piece of Content unless matching identifiers exist in the identifier column in the import file OR when Key Fields are selected before import. Identifiers will be checked by the importer BEFORE keyfields so there is no real point in using both identifiers and keyfields. For this reason, identifier DOES NOT appear as a "checkable" keyfield on import and should merely be added as an additional column in the CSV import.
- File to Import: Click the Browse button to find the CSV file on your local machine to upload.
Clicking on the "Go to Preview" button will generate an import preview page that displays the expected results of the import without actually importing the Content. Examine the "Preview Analysis Results" and look make sure that there are no warnings or errors that might interfere with a successful import of Content.
If there are errors or warnings displaying in the notification, you may wish to click the "Go Back" button and correction of the CSV file may be necessary. Otherwise, click the "Proceed to Import" button to complete the Content import process.
After giving the import process time to complete, check the Content tab to view the contentlets for the imported content type.
If the content type has an image field, images can be imported to the content as long as the images HAVE ALREADY BEEN UPLOADED to the dotCMS Site Browser tree. Please note that the image paths in the CSV file (shown right), correspond to the dotCMS Site Browser tree on the host being imported to, NOT to the local file system of the user who is doing the import.
If the file in the import does not have a proper image file extension, it will not be uploaded to the content. A row should be left blank under the image column if no image is associated with the content being imported.