Kentico CMS 6.0 Developer's Guide

Final steps

Final steps

Previous topic Next topic Mail us feedback on this topic!  

Final steps

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

This topic explains the final steps of Kentico Import Toolkit wizard. To learn about the preceding steps, please refer to the Initial steps topic and the topics about data selection for import from an MS SQL database, XML file or CSV and XLSX files.

 

7. In Step 5, a preview of the data to be imported is displayed. This step is only informative and you can use it to check if you specified the source data correctly in the previous steps. If so, click Next to proceed.

 

devguide_clip1726

 

8. In Step 6, you perform mapping of source fields to target fields. The utility automatically recognizes fields that appear to be equivalent, so if names of the fields or at least their suffixes are matching, most of the fields should be mapped automatically and you only need to check and fine‑tune the mappings. If you want to return to the default mappings after adjusting them, you can do it by clicking the Reset to default mappings link above the grid.

 

The mappings grid contains the following columns:

 

Target field - field of the target object/document into which data should be imported. If you enable the Show advanced columns check-box above the grid, additional columns that you typically wouldn't use as an import target are offered as well.

Required - indicates if the target field is required.

Source field or expression - source field from which data will be imported into the target field. You can use the following expressions in its text to get the values dynamically:

=macroexpression - evaluates the specified macro expression using the source data and uses its result in the value. E.g. ={%ItemText%} - {%ItemOrder%}.

#<source>query - executes a query against the source database and uses the result in the field. E.g. #<source>SELECT TOP 1 UserID FROM CMS_User WHERE UserName ='{%SourceUserName%}' .

#<target>query - executes a query against the target database and uses the result in the field. E.g. #<target>SELECT TOP 1 ... .

#<file> - you can specify a file using a URL or a disk path. Binary data of the file will be used as the value of the target field.

Default value - value that is used if the source field does not contain any value (or when its value is NULL).

FK mapping file - you can specify an .fkmap file from a previous export session which converts an ID field to a new field mapped in the previous session. See below for more details.

 

If you selected to skip or overwrite existing objects in Step 2 of the wizard, you can specify a WHERE condition in the field below the list. Based on this, the existing objects to be skipped or overwritten will be identified.

 

When importing the data as documents, there is an extra field below the grid where you need to specify a path to the document under which you want to created the imported documents. When importing the data as document attachments, there is also an extra field below the grid while in this case, you need to specify a path to the document to which you want to attach the imported attachments.

 

You can also enable the Save the old ID to new ID mappings to file check-box. This enables you to save mappings of source ID columns to target ID columns into an .fkmap file that can be used during another session in the FK mapping file column above. Let's explain the use of the file by the following example:

 

Imagine you have a list of question and a list of answers where an answer is bound to a question with a foreign key.

You want to import both and preserve their binding.

You first import the questions, and save the ID mapping to a questions.fkmap file.

Then you import the answers and use the questions.fkmap file in the FK mapping file column of the field that contains the foreign key.

 

Once you have the mappings specified, click Next to proceed to the following step.

 

devguide_clip1727

 

9. In Step 7, you can see a preview of the data as it will look when imported to the target. Before proceeding, you can choose how you want the data to be imported:

 

Import the data - imports the specified data into Kentico CMS.

Do not import anything (use if you only want to save profile) - skips the actual import. This is useful if you want to save the profile in the final step of the wizard. Please note that the profile can also be saved in any other step by clicking the Save profile button.

Only simulate the import (does not commit the changes) - performs the import to validate that the data is correct, but does not commit the changes to the database.

 

After making your choice, click the Import data button to perform the import.

 

devguide_clip1728

 

10. A log will be displayed, showing you the progress of the import.

 

devguide_clip1733

 

11. When an error occurs during the import (e.g. when there are restricted characters in imported data, NULL values in required columns, etc.), the dialog depicted in the screenshot below is displayed. In it, you can see an error message explaining the issue and you have the following options:

 

Abort - aborts the whole import process.

Retry - you can correct data in the displayed row and click this button to import the corrected data, without the need to correct the data in the source and go through the import process again.

Ignore - the current record will be skipped and not imported.

Ignore all - all records containing errors will be skipped during the rest of the import, without this window being displayed.

 

devguide_clip1735

 

12. At the end, a final screen of the wizard is displayed, informing you about the result of the import. Imported data should already be visible in Kentico CMS at this point. The following actions can be performed on the final screen:

 

Show log - opens the import log that was displayed while import was being performed.

Import other data to the same project - redirects you to Step 2 of the wizard, with the web project used in the previous session preselected in Step 1.

Start new import session - redirects you to Step 1 of the wizard where you can start a new import session.

Close the import tool - closes the utility.

 

devguide_clip1729