Continuation of Install Commerce Categories Migration Tools
3. Create Commerce Categories
The Commerce Category Import tool lets you import the CSV file generated by the Site Category Export tool. The import tool uses data from the exported CSV file to create Commerce Categories.
The Commerce Category Import tool performs the following actions:
- Creates a new Commerce Category record if a row does not provide the internal ID of an existing Commerce Category record.
- Updates an existing Commerce Category record if a row specifies the internal ID of an existing Commerce Category record.
Create the CSV File
Ensure the Commerce Category Import tool has been correctly configured before you use it.
ou can access the Commerce Category Import tool by going to Setup > Import/Export > ImportCSV Commerce Categories.
When creating the CSV file, be aware of the following:
- Site Builder Category names can have a maximum of 80 characters. Commerce Category names have a maximum of 32 characters. Ensure your CSV file does not contain category names with more than 32 characters.
- A header row is required.
- Use commas to separate columns and newline to separate rows. Other delimiters are not supported.
- The Commerce Category Import tool attempts to determine the correct newline sequence. Most users will not need to take any action. For advanced users, the tool uses a newline sequence at the end of the header row. It searches for ‘\r\n’ with fallback to ‘\n’.
- Field values containing a comma, newline, or double quote must be escaped. Microsoft Excel should automatically handle this for CSV files with no additional action required. For editors that do not handle this automatically, escape the field values as follows:- Enclose the entire field value in double quotes.
- Escape double quotes in the value with another double quote.
 
Create Commerce Categories
Subcategories and item sublists cannot be set when you create Commerce Category records. They are set when you map the Commerce Category fields.
Categories are created at the root level. This is not an issue unless two or more categories use the same URL fragment. If you do have two or more categories that use the same URL fragment, you need to perform additional steps to import the category data. The appropriate steps to take vary depending on your situation, but two possible solutions are:
- Create categories and define the subcategory structure in multiple, smaller batches. You should follow this step if you are not an advanced user.
- Import all parent categories first, then perform a second import to create the subcategories and specify the parent categories’ internal ID in the new subcategories’ Primary Parent field.
Note – Using the Primary Parent field to specify the subcategory structure may cause issues when defining subcategories and item associations. Follow this step only if you are an advanced user.
Define Subcategories and Item Associations
Use the internal IDs of the Commerce Categories already created to update categories with subcategory and item associations.
One subcategory and one item may be added per row. Adding multiple subcategories or items to a category requires multiple rows to update the category. If a subcategory does not have a primary parent specified, the first parent category it is added to automatically becomes its primary parent.
Specify the Order of Subcategories and Items
The order of subcategories and items is determined by the order of the rows they are added to.
Step 4 – Set Field Mapping