Skip to main content
17-Peridot
September 14, 2022
Solved

Cleanup Thingworx Database - PostgreSQL/MSSQL

  • September 14, 2022
  • 2 replies
  • 3487 views

We have installed thingworx 9.1 with postgreSQL using installer. Create more than 50+ entities and done a kind of an PoC. How to cleanup everything and make just like fresh installation instance without uninstallation?

Best answer by danmorin

Hi, 

 

Is this one licensed or hasn't licensed yet?

If it hasn't been licensed just create a new schema on Postgres and change the database on platform-settings.json. This will make your ThingWorx as fresh as it is first installed. I don't now about the licensed one whether it will cause a problem or no.

 

Thanks

2 replies

15-Moonstone
September 19, 2022

Hi,

Steps to be followed:

Write service that does following :

1. Query / get the list of 50+ entities either  grouping by project name or grouping by Tag

2. Based on the type of entities , delete the entities programmatically 

 

Hope this helps! 

17-Peridot
September 20, 2022

@Ashritha Thank you for the suggestion. 

Here we are facing few entity dependency errors.

Can you please suggest how to delete (Thing, ThingTemplate, Thingshape, Datashapes and StyleDefinitions, Mashups etc) without getting entity dependency errors?

15-Moonstone
September 21, 2022

Hi,

Delete entities in following order

Mashups, StyleDefinitions, Things, Thingshapes , ThingTemplate , Datashape

 

Hope this Helps!!

danmorin1-VisitorAnswer
1-Visitor
September 20, 2022

Hi, 

 

Is this one licensed or hasn't licensed yet?

If it hasn't been licensed just create a new schema on Postgres and change the database on platform-settings.json. This will make your ThingWorx as fresh as it is first installed. I don't now about the licensed one whether it will cause a problem or no.

 

Thanks

17-Peridot
September 20, 2022

@danmorin Its a licensed one and installed with Thingworx Installer. Not sure about running creating new schema on Postgres/MSSQL. 

 

Is there any difference between manually thingworx installation and auto installation with installer?

1-Visitor
September 20, 2022

Yes, with Installer you just create a schema on the database then the table will be created by ThingWorx. But in the manual, you need the create schema and also the table inside manually. The solution that I was giving requires you to create schema and table manually which I think would be risky if you haven't performed any of manual installation yet because you might miss few things.

 

You can try to remove each entity one by one according to each dependency, remove the independent entity first which will make the other dependent entity will become independent.