Import Toolkit - Path cannot be empty error

Landon Hulcy asked on December 13, 2019 20:04

I keep getting the following error when trying to use the Import Toolkit.

"An error occurred on import: Path cannot be empty Parameter name: path"

I have the following settings set.

Data type to import: Pages

Import options: Import new and overwrite existing pages

Data source: SQL query

Import the pages under following parent path or parent node ID: /Sites

Where condition: {%SiteExternalMasterSiteID%} = SiteExternalMasterSiteID

I have the Kentico field "SiteExternalMasterSiteID" mapped to the external datasource field "MasterSiteID". I have tried every combo of MasterSiteID and SiteExternalMasterSiteID in the where clause to figure out why this is not working, but I get this same error every time.

What am I doing wrong here?

Recent Answers


Brenden Kehren answered on December 16, 2019 15:06

Does the path /Sites currently exist in the site you're importing the content to? If no, you need to create the path in the content tree.

0 votesVote for this answer Mark as a Correct answer

Landon Hulcy answered on December 16, 2019 15:18

Brenden,

Yes the path /Sites exists in the site. If I take out the where clause, the import will work and it will create all rows of data as a new page. It's only when I have the where clause that it throws this error.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 16, 2019 15:22

Totally missed the macro in the where condition. As far as I know macros don't work in KIT. So you'd have to hard code that SiteID to a site ID known to you or perform another lookup to get that.

1 votesVote for this answer Mark as a Correct answer

Landon Hulcy answered on December 16, 2019 15:28

Oh... If that's the case then what is the point of that Where clause if I cannot compare an ID or field in my external database to the ID or field in the Kentico database? That means the Where clause in the KIT has no additional benefit over just using a where clause in the SQL query.

How can I both insert new pages and update existing pages with updated information without this functionality?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 16, 2019 15:34

I stand corrected as I reviewed the documentation quick. I'd suggest reviewing a bit more to see if this helps you.

On a side note, there is a huge benefit of using KIT over using the standard SQL Import. When importing or updating it uses the API to perform these inserts or updates so you get the business logic behind the import process whereas with standard SQL Import you won't get any of that.

0 votesVote for this answer Mark as a Correct answer

Landon Hulcy answered on December 16, 2019 16:32

I have followed the documentation very carefully before asking for help and I followed it again after you suggested it. I am doing exactly what is recommended but it is still throwing a bogus error. I know this error does not make sense because when the Where clause is not met, the import works correctly. It is only when the where clause does match up that it fails.

Here is the query that was sent by the import tool kit to kentico to get the matched rows.

SELECT *
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) INNER JOIN Info_Site AS C WITH (NOLOCK) ON [V].[DocumentForeignKeyValue] = [C].[SiteID] AND V.ClassName = N'Info.Site' LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID]
WHERE (SiteExternalMasterSiteID = '600')

This query is also followed by a number of SELECTs and UPDATEs for the various kentico tables in relation to this import. So it acts like it is moving through the process but still throwing this ambiguous error.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.