Switching from TDS to Unicorn – some useful verifying SQL scripts

On of my project we switched from TDS to Unicorn. After we configured Unicorn and set up dependencies between configurations I wanted to verify that every item was migrated from TDS (*.item) to Unicorn (*.yml) in the database successfully.

I wanted to check by the following points:

  • Is there any difference between field values?
  • Detect missing items
  • Detect missing field values

First I needed to setup one Sitecore instance for TDS (tds910) and one for Unicorn (unicorn910). I deployed (TDS) and syncronized (Unicorn) the items and then ran the following few scripts.

In most cases I needed to compare 2 tables – SharedFields or VersionedFields. In your case maybe you need to also run the scripts above for UnversionedFields.

Detect difference between field values

I ignored the following fields to give me meaningful results:

  • Updated
  • Revision
  • Created
  • Updated by
  • Owner
  • Created by
  • Lock
  • Blob

You can add more filters or remove these from the script below.

Detect missing items

This is quite obvious: I would like to have the list of items which are in TDS but not in Unicorn accidentally.

Detect missing field values

This one also quite obvious: I would like to have the list of field which are in TDS but not in Unicorn accidentally.

If you would switch from Unicorn to TDS, you can use the same scripts, you just need to change the table and alias names in scripts above. I hope it helps a bit! If you have any question or remark let me know!

2 thoughts on “Switching from TDS to Unicorn – some useful verifying SQL scripts

  1. Why use something you don’t already use daily as a Sitecore dev? Once you serialized your stuff with unicorn and reserialized it on a fresh instance, you can just connect tds to that instance and you should see no changes when the sync is complete. Your approach is probably working just fine, but in the future the DBs might change and TDS should be updated to handle it if it needs to.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s