Installation and deployment
Version 7.x > Installation and deployment > Kentico importing documents with same GUID View modes: 
User avatar
Member
Member
Boolean - 3/5/2013 6:22:50 PM
   
Kentico importing documents with same GUID
Hi

I'm not sure if this is a bug or intended behaviour.

I have two sites in one instance of Kentico. While the layout between the two is different the content is mostly the same. I exported the documents using the site export tool from SiteA and imported them back into SiteB (which has no content). Everything seemed to be going fine but I noticed that now in the database all the documents that I imported in share the same GUID as the documents from SiteA.

This causes issues where I am retrieving or saving documents by their GUID values. It also seems to defeat the purpose of a GUID somewhat.

Is this working as intended?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/5/2013 7:00:31 PM
   
RE:Kentico importing documents with same GUID
Hi,

You are importing the data - it is like restoring a DB - you will have the same GUIDs too. The GUID is not the only identifier of the document. I would recommend using it together with the SiteID culture and alias path.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Boolean - 3/6/2013 8:11:33 AM
   
RE:Kentico importing documents with same GUID
Which I could understand if the data was in different tables, but if the GUIDs (The global unique identifiers) can have duplicates in the same table - what's the point of using GUIDs?

Is there any other data we should be aware of that uses a GUID that is not actually unique? For example the DocumentWorkflowCycleGUID also uses the same GUID for both documents - Is this going to cause issues when we turn workflow on?


User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/6/2013 9:36:57 AM
   
RE:Kentico importing documents with same GUID
When a GUID is auto generated, it will not create a duplicate in the same column of a given table. Kentico Support, correct me if I'm wrong, but GUID's are used primarily for Content Staging. Don't get me wrong, you can use them to store permenant URLs and getting document info (and I use both of those religiously) but they are a must for Content Staging.

GUIDs are unique by machine, database, table. With that being said, there is nothing stating during an import or insert process you can't turn a few switches "off" and allow insert of a GUID that was not auto generated just like you can with a PK field.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/6/2013 5:06:58 PM
   
RE:Kentico importing documents with same GUID
Hi,

The GUID is the same also if you restore a DB. The import is basically just inserting some values to the DB - like when you create a SQL statement to insert values and you will use the same GUID. I do not see any issues with this and as mentioned below, they are mostly used for content staging. However, all the items are checked by several attributes to ensure the uniqueness. This design is ever since and there were no issues in workflow nor other modules with the same GUIDs in deployments with hundreds of sites created using the same web site template, import package. This is ensured by the code.

Best regards,
Juraj Ondrus