• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Joining datasources

    How-To
    3
    8
    2.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phillip Weeks
      last edited by Phillip Weeks

      What is the easiest method to take all values from a persistent-TCP datasource and feed them back into a Modbus I/P data source containing the same point xid's?

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by

        The best I've got was writing a dashboard screen to extract all values from one point, in iterations if needed. replacing the old XID with the destination point XID and convert the data to csv and downloading the generated file to my computer. once I'd finished generating all of them, I used the data import option on the old UI to update all of the points. Sorry that's the best I managed to do with what I had. I half would have thought the points would update if the XIDs are the same but not sure Mango would allow it (I believe it treats it like a unique key).

        Fox

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          Lots of ways!

          1. Have the H2 database available as well, change the XID to remove the publisher's prefix from the points on the persistent data source (if any). Use the "Migrate NoSQL Data into Mango" tab on /mango_no_sql.shtm to copy all data over based on matching XIDs between the SQL databases.
          2. Figure out the ID of the point you wish to copy the data to, and the ID of the point you wish to copy the data from. Copy the files directly from Source Mango/databases/mangoTSDB/x/ID/* to Target Mango/database/mangoTSDB/x/ID/ so you need to find the existing ID folders in each. Then restart Mango.
          3. Create a new publisher from the side with all the data, and sync the data into new points on the target. Then, delete all the new points and change the IDs of the Modbus points to match, and restart Mango.
          4. Do what Fox described and upload the data to the data import module.
          1 Reply Last reply Reply Quote 0
          • P
            Phillip Weeks
            last edited by Phillip Weeks

            Phil please elaborate on 3 further.. Assuming I use only the target installation with the persistent TCP data source which contains all the data... If I then delete this TCP data source, will the NoSQL data be unaffected? And can I then create a new Modbus data source on the same installation using the same xid's and this new Modbus data source will find these former persistent TCP values in the NoSQL on restart??

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by

              If I then delete this TCP data source, will the NoSQL data be unaffected?

              Orphaned point values are deleted during the nightly purge.

              And can I then create a new Modbus data source on the same installation using the same xid's and this new Modbus data source will find these former persistent TCP values in the NoSQL on restart??

              You could do something close to that. But, upon creating the Modbus data source you would need to change the IDs of the points to the IDs those XIDs had when it was a persistent data source. So before deleting that data source, you could,

              select id, xid from dataPoints where dataSourceId=(select id from dataSources where xid='Persistent Data Source XID');
              

              paste the output into a text editor, and do some regex find and replace to

              find: .*?(\d+)\t+(.*)
              replace: UPDATE dataPoints SET id=\1 WHERE xid='\2';
              

              and there's the update statements for after the Modbus data source has been created. After running the statements, I would restart Mango (or at least the data source).

              1 Reply Last reply Reply Quote 0
              • P
                Phillip Weeks
                last edited by

                So do I run this and each time replace the 'Persistent Data Source XID' with the literal value for all xids in this ds? there are 2700 points in this data source so I could never do this step for 2700.

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  No... just the XID for the data source.

                  1 Reply Last reply Reply Quote 0
                  • P
                    Phillip Weeks
                    last edited by

                    Thanks Phil.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post