Skip to main content
1-Visitor
October 20, 2016
Question

How to copy content of an existing valuestream (cloning)

  • October 20, 2016
  • 2 replies
  • 6617 views

Hi guys,

finally Jive is up and running so I can post my questions.

Does anyone know how to clone valuestreams, i am re-designing one of my older projects and I need to change the name of the valuestreams used, obviously this is not possible, but I dont want to loose any data which I've collected. Value stream will be assigned to the same thing templates, properties are the same.

I know how to clone Streams, but I am not sure how to do it for ValueStreams  (because of timestamps and so on).

Any ideas?

Thanks a lot

2 replies

1-Visitor
October 21, 2016

You can export everything on a csv file, and then reimport it again on the new Value Stream for instance.

tcoufal1-VisitorAuthor
1-Visitor
October 21, 2016

Hi Carles,

thanks for that,

could you elaborate on this. I will use data exporter to get the csv out, which will contain logged properties and timestamp of their logging.

Which service should I use to fill the new valuestream with those csv data?

Thanks a lot

1-Visitor
October 21, 2016

Hi Tomas, don't use Data Exporter extension, use CSV Parser one: http://marketplace.thingworx.com/Items/csv-parser you can write/read CSV files with it.

1-Visitor
November 21, 2017

Hi Tomas,

Sorry to deviate from your question. I have a query, if you could help me on the method to clone streams . I have a huge data in my stream and want to delete older entries in it after cloning. Please suggest a method without using for loops.

tcoufal1-VisitorAuthor
1-Visitor
November 21, 2017

Hi,

Are you talking about ValueStream or Stream.

I dont know if I can recommend it, but I am now doing some heavy duty stuff directly via SQL.

I was logging incoming SQL statements in db (which is super easy in Postgre, I was once doing the same on MySQL and it was terrible) to find out what is happening "under the hood" and all seemed pretty straight forward. So you can use SQL to copy records in StreamTable and delete what you want. Obviously DB will not check if parameters (stream name, source, tags, etc.) refers to existing entities in TW or nut, but if you careful it will help you to speeds things up.

Carles what do you think if you are reading this? 

1-Visitor
November 22, 2017

If it's really huge date, maybe Tomas Coufal solution ( custom SQL ) would be the most viable, and of course if it's for just one time task ( of course if you are on PotgreSQL and other relational databases, if you are on Neo4J or H2 you are out of luck ).