Try our conversational search powered by Generative AI!

Deleting old EPiServer.Commerce.Catalog.Provider.CatalogContentDraft items after migration to Commerce 9


Is it safe to delete old CatalogContentDraft items after migration to 9, which uses diferent versioning system. 
They take alot of space.
I'd like to use this code:
DynamicDataStore jobDataStore = typeof(CatalogContentDraft).GetStore();
var items = jobDataStore.Items().Count();

I don't see anything regarding this in the migration docs.

May 17, 2017 15:45


the data migration should remove the CatalogContentDraft instances when it creates the corresponding versions in the new version system. Not all the drafts are migrated during the upgrade (migration step) though. "Non-active" versions are migrated using a scheduled job (see

If for some reason you still have CatalogContentDraft instances in DDS after completing all the migration steps, those will not be used by Commerce and should be safe to delete like you suggest.

May 17, 2017 20:16

Note that you can run DBCC SHRINKDATABASE after deleting the draft version. It can reduce your DB size quite significantly 

May 17, 2017 22:50

Is there a way to somehow increase timepout for this deletion? I'm getting timeout because there are very many objects.


May 18, 2017 7:26

Does it time out on the Count() or the DeleteAll()? Skip the count if you don't need it, I suspect it will try to load all data into memory. If the DeleteAll times out, you can try increasing the deleteAllOperationTimeout setting of the episerver.dataStore/dataStore config section (see

Or try to loop the items and delete individually instead (it might help to select just the Identity property then maybe it won't load the entire object).

May 18, 2017 8:20

It times out on deletion. I'll try to increase timeout

May 18, 2017 11:34

It's generally bad practice to do something in SQL if you can do it in APIs, but in this case you can delete those old versions from tblBigTable (filter for StoreName). Remember to backup your databases first. And IISReset will be needed after that 

May 18, 2017 15:12

In this case I would really try everything to avoid direct SQL. It risks leaving orphaned items of other types behind, items that were referenced by the drafts. It will also miss associated tblBigTableReference rows. Possibly it could be better to delete from the CatalogContentDraft SQL View, but I'm not sure that would take care of referenced items either.

May 18, 2017 20:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.