CMS (Formerly Content Manager): Importing Content into a Collection
5 min read
Save time and effort by importing content to your collection from a CSV (comma-separated value) file.
This feature can be particularly helpful if you already have all your information stored in a spreadsheet, or if you want to export your content, make changes to it in a spreadsheet application, and then import it back into your collection.
Preparing your CSV file for upload
A properly prepared CSV file will make importing content into your collections both straightforward and reliable.
Your CSV file must use commas as the delimiter between fields. The first row in your file serves as the header. It represents the fields in your collection. The rest of the rows in your CSV file are the content you want to import.
Your CSV file must meet the following criteria:
- Not be larger than 1 GB
- Not have more than 50,000 items. If you need to import more items than that, save them in separate CSV files and import them one by one.
- Not have more than 1,000 fields.
Rules and limitations of different field types:
Your CMS (Content Management System) can store different types of content, so it is important that you carefully manage the different field types when importing from a CSV file.
Date and Time fields
The content is not validated when you import it. You must make sure that your content in your CSV file matches the field types in your collection.
Uploading your CSV file
Now that you have a properly prepared CSV file ready to upload to your collection, keep in mind the following points before you proceed:
- Your CSV file name does not have to match the name of your collection.
- If your collection has non-Latin characters, make sure your CSV file has UTF-8 encoding.
- If you've enabled the Sandbox mode, syncing your Sandbox collection to Live copies the content over to the Live collection. You can learn more about the Sandbox here.
To upload your CSV file:
- Go to CMS in your site's dashboard.
- Click the relevant collection.
- Click More Actions.
- Click Import Items to import content to your Sandbox collection.
- Click Choose a File.
- Select your CSV file.
- Map the columns from your CSV to your Collection:
- (Optional) Select New field under Configure Column If your CSV file contains a column that does not match any field in your collection or you want to import it as a new field.
- Enter a Field Name.
- Enter a Field Type.
- Click Next.
- Review your file import and click Import.
- Publish your site.
If you've enabled the Sandbox mode, then sync your content between your Sandbox and Live collections to import the content to your Live Collection.
During Step 7 of the upload process, you can choose which columns you want to import from your CSV file and which fields they link to in your collection. By default, all columns are selected. Columns with the same names or keys as fields that already exist in your collection are mapped by default.
As you select a column on the left, the right side of the screen displays a sample of the content in black. If there is a problem, such as a mismatch between the field type and the content being imported, the examples are listed in red.
When you import a file into your collection, a backup is created in the background. You will get a notification to confirm your file has been imported and the backup has been created. You can revert to the pre-import version of the collection if required.
This process does not overwrite the automatic backup of your collections - it creates a manual backup instead.
Updating existing items
You can update existing items in your collection by importing content from a CSV file that includes the item IDs. The easiest way to do this correctly is to make sure to include the ID field when exporting the content.
- If your collection already contains items with those IDs, you can choose whether to overwrite them with the content from your CSV file or to skip them.
- If your collection does not contain items with those IDs, the rows are added as new items, using the IDs listed in your CSV file.
Using the Sandbox when updating existing items
When the Sandbox is enabled, you can import content to your Sandbox collection in the Editor. When importing into your Sandbox collection, you can add new fields to the collection structure at the same time. In other words, you can include columns in your CSV file that do not yet exist in your collection.
At the time of import, you can add these new columns to your collection structure and then import the content to them.