How can I reset the PIM

How can I reset the pim? Want to remove all data from PIM module. Assortments, Categories, Products, Variants, FieldTemplates, DisplayTemplates etc. Is there any script to run on the database?

Litium version: 6.2.1

You can use the following script in order remove everything from PIM module, do not change the order of the sql-commands.
Stop your application. Run the script on the database. Start your application again. Do not forget to rebuild the indices.

        DELETE FROM Products.BaseProductCategoryLinkActiveVariants;
        DELETE FROM Products.BaseProductCategoryLink;
        DELETE FROM Products.BaseProductProductListLinkActiveVariants;
        DELETE FROM Products.BaseProductProductListLink;
        DELETE FROM Products.RelationshipLink;
        DELETE FROM Products.RelationshipTypeEntity;
        DELETE FROM Products.PriceListItem;
        DELETE FROM Products.InventoryItem;
        DELETE FROM Products.UnitOfMeasurementEntity;
        DELETE FROM Products.ProductList;
        DELETE FROM Products.Category;
        DELETE FROM Products.Assortment;
        DELETE FROM Products.VariantBundleLink;
        DELETE FROM Products.Variant;
        DELETE FROM Products.BaseProduct;
		DELETE FROM Products.FieldDefinition;
        DELETE FROM Products.FieldTemplate;
        DELETE FROM Products.DisplayTemplate;
        DELETE FROM Products.Inventory;
        DELETE FROM Products.PriceList;
        DELETE FROM Products.UrlHistory
        DELETE FROM Workflows.TaskMatchLink;
        DELETE FROM Workflows.TaskAssignedLink;
        DELETE FROM Workflows.Task;
        DELETE FROM Workflows.Workflow;
3 Likes

Thanks for your contribution Utku!

In a scenario, where FieldDefinition, FiledTemplate, displayTemplate are fine as they are, can we safe NOT running them in the Delete sequence (simply avoiding them)

A wild(?) guess is that the tables in the sequence you recommend, after Inventory, URL history, Workflows.xxx NOT has direct relation to those template and therefor can be avoided. Iā€™m I right here or do I have to delete them?

Thanks. Erik

If you want to keep Inventory and PriceList you do not need to delete those, but you have to delete UrlHistory and Workflows.XXX since you are deleting ProductList, BaseProduct, Category and Variant.