<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mango 3.7 restore]]></title><description><![CDATA[<p dir="auto">Hello Mango Forum,<br />
We have had a database corruption in the MySQL tables. I have reinstalled the MySQL server/service and am wondering about the restore process for Mango 3.<br />
We have weekly back ups so I would not be losing too much in the way of data and configurations.<br />
my questions is:<br />
Will the Mango restore process also restore the MySQL tables?<br />
Will the restored backup be restored into a newer version of MySQL tables?</p>
<p dir="auto">Thank you for your help.</p>
<p dir="auto">Cheers<br />
Brian</p>
]]></description><link>https://forum.mango-os.com/topic/5801/mango-3-7-restore</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 12:16:50 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/5801.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 Mar 2024 10:11:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 11:31:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bg" aria-label="Profile: BG">@<bdi>BG</bdi></a> sorry instantiated sqlClassInstance twice... Have edited the code above.<br />
Please try again<br />
Fox</p>
]]></description><link>https://forum.mango-os.com/post/28150</link><guid isPermaLink="true">https://forum.mango-os.com/post/28150</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 10 Apr 2024 11:31:37 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 11:29:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Hello Matt,<br />
Sorry for my ignorance, but I ran your code in my SQL console and I got an error.</p>
<p dir="auto">com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'var dbProxy,JDBC,sqlClassInstance; var DatabaseProxy=com.serotonin.m2m2.db...' at line 1</p>
<p dir="auto">I am not sure if I was supposed to change any of the the values.</p>
<p dir="auto">Cheers<br />
Brian</p>
]]></description><link>https://forum.mango-os.com/post/28149</link><guid isPermaLink="true">https://forum.mango-os.com/post/28149</guid><dc:creator><![CDATA[BG]]></dc:creator><pubDate>Wed, 10 Apr 2024 11:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 11:30:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bg" aria-label="Profile: BG">@<bdi>BG</bdi></a> I don't know if<br />
USE DATABASE (try from the sql console)<br />
will work (permissions in MySQL will play a role here), but I have written something to call the update method from that page via the java classes inside of  mango JavaScript code:</p>
<pre><code> var dbProxy,JDBC;

var DatabaseProxy=com.serotonin.m2m2.db.MySQLProxy;
var sqlConsole = com.serotonin.m2m2.db.dao.SqlConsole;
if(!dbProxy)
{   
    dbProxy =  com.serotonin.m2m2.Common.getBean(DatabaseProxy.class);
    dbProxy.getContext();
}   

 if(!JDBC)
    JDBC = dbProxy.getJdbcTemplate();
    

var sqlClassInstance = new sqlConsole(JDBC);
var sqlQueryResult = JDBC.update(sqlquery);
com.serotonin.m2m2.Common.getBean(DatabaseProxy.class).terminate();

print (sqlQueryResult);
</code></pre>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/28148</link><guid isPermaLink="true">https://forum.mango-os.com/post/28148</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 10 Apr 2024 11:30:38 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 10:57:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Hello Matt,<br />
Yes they are on the same server just different databases. I hadn't thought about copying the data to a table in the Mango MySQL Db.</p>
<p dir="auto">Would that solve anything?</p>
<p dir="auto">Cheers<br />
Brian</p>
]]></description><link>https://forum.mango-os.com/post/28147</link><guid isPermaLink="true">https://forum.mango-os.com/post/28147</guid><dc:creator><![CDATA[BG]]></dc:creator><pubDate>Wed, 10 Apr 2024 10:57:25 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 10:51:48 GMT]]></title><description><![CDATA[<p dir="auto">Are these database tables on the same sql server as mango? Or even in the mango Db?</p>
<p dir="auto">May be able to leverage the sql console module...</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/28146</link><guid isPermaLink="true">https://forum.mango-os.com/post/28146</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 10 Apr 2024 10:51:48 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 10:36:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bg" aria-label="Profile: BG">@<bdi>BG</bdi></a> Sounds like you're on the right track. Your point links in scripting datasources will work by using them as context points, one of which (the source) is used to update the context and you set the value of the target point with<br />
<code>target.set(source.value)</code></p>
<p dir="auto">I'll need to think a little re your sql conundrum though...</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/28145</link><guid isPermaLink="true">https://forum.mango-os.com/post/28145</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 10 Apr 2024 10:36:25 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 10:16:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Instead of starting a new thread I will explain what we are doing here. I don't think too many people are searching for Mango 3 solutions anymore.</p>
<p dir="auto">Our dataloggers have the ability to store its data locally during a mobile data connection loss. Once the data connection is restored the logger could potentially upload 100K rows of data to the MySQL database in a very short period of time. The other eccentricity of the loggers is that the digital channels only send data on a state change. we do not get an the current digital state value on every record that is sent.</p>
<p dir="auto">So we need to be able to read the data from earliest to latest, and if there is no new data, mango needs to be able to go back to the last non null digital point found in the already read rows of data.</p>
<p dir="auto">So to make sure Mango reads the data into the NoSQL database sequentially in timestamp order, we use the flag method to mark which rows have been read and identify the next row to be read.</p>
<p dir="auto">We use a SQL data source to bring the data into mango, then use a Meta data source to scale the data for display on the dashboards, trigger alarms etc, as you know.</p>
<p dir="auto">In the SQL data source we have a series of coalesce select statements as shown:</p>
<pre><code>Select date, flag,
coalesce(
         	(SELECT an1 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT an1 FROM staging_all where grd_id = 0100 and flag = 1 and an1 IS NOT NULL order by date desc limit 1)
                     ) as an1,
coalesce(
         	(SELECT an2 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT an2 FROM staging_all where grd_id = 0100 and flag = 1 and an2 IS NOT NULL order by date desc limit 1)
                     ) as an2
coalesce(
         	(SELECT i1 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT i1 FROM staging_all where grd_id = 0100 and flag = 1 and i1 IS NOT NULL order by date desc limit 1)
                     ) as i1,
coalesce(
         	(SELECT i2 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT i2 FROM staging_all where grd_id = 0100 and flag = 1 and i2 IS NOT NULL order by date desc limit 1)
                     ) as i2
from staging_all 
where grd_id = 0100
and flag = 0
order by date asc 
limit 1;


</code></pre>
<p dir="auto">This works well for us and as you can see gives us the choice of picking the earliest unread or the latest read row of data.</p>
<p dir="auto">I then have a data point in the SQL data source called zflag that had this statement:</p>
<pre><code>UPDATE GRDXF.staging_all SET flag= ?  WHERE grd_id=0100 AND flag=0 ORDER BY date ASC LIMIT 1;
</code></pre>
<p dir="auto">The question mark is the integer parameter assigned via the point link which just says "Return 1;"</p>
<p dir="auto">I tried putting that line in the SQL data source code as below without the parameter ?:</p>
<pre><code>Select date, flag,
coalesce(
         	(SELECT an1 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT an1 FROM staging_all where grd_id = 0100 and flag = 1 and an1 IS NOT NULL order by date desc limit 1)
                     ) as an1,
coalesce(
         	(SELECT an2 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT an2 FROM staging_all where grd_id = 0100 and flag = 1 and an2 IS NOT NULL order by date desc limit 1)
                     ) as an2,
coalesce(
         	(SELECT i1 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT i1 FROM staging_all where grd_id = 0100 and flag = 1 and i1 IS NOT NULL order by date desc limit 1)
                     ) as i1,
coalesce(
         	(SELECT i2 FROM staging_all where grd_id = 0100 and flag = 0 order by date asc limit 1), 
         	(SELECT i2 FROM staging_all where grd_id = 0100 and flag = 1 and i2 IS NOT NULL order by date desc limit 1)
                     ) as i2

from staging_all 
where grd_id = 0100
and flag = 0
order by date asc 
limit 1;

UPDATE GRDXF.staging_all SET flag= 1  WHERE grd_id=0100 AND flag=0 ORDER BY date ASC LIMIT 1;

</code></pre>
<p dir="auto">This works manually in the MySQL workbench but this failed in Mango. I think the reason it fails in Mango is that the SQL data source is a read only unless the data point has the Modify Table attribute ticked. So I can't add the update statement to the data source SQL code.</p>
<p dir="auto">I did some digging in the forum from the time when IAS was going to remove the point links after version 3.7.7 and the only comment I could find was that point links could be accomplished in the Scripting data source but didn't give much more detail on how. I apologise if the "How" was in the early form but i didn't find it.</p>
<p dir="auto">So I started to look there and first of all I can't see how to create a connection to the MySQL database as in the SQL data source.</p>
<p dir="auto">Then  as I am writing this I started to realise that I think I am supposed to use the Scripting data source to recreate the Source Point and the Target point that was chosen as drop downs in the Point Link. And if that IS the case, that is where I am stuck.<br />
I am researching about using Ecmascript to use target  and source points to provide a parameterised integer to my SQL data point that can modify the table.</p>
<p dir="auto">Once I have that figured out I think our system will be back to normal.</p>
<p dir="auto">Thank you for your time in reading this lengthy post.   :)</p>
]]></description><link>https://forum.mango-os.com/post/28143</link><guid isPermaLink="true">https://forum.mango-os.com/post/28143</guid><dc:creator><![CDATA[BG]]></dc:creator><pubDate>Wed, 10 Apr 2024 10:16:17 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Wed, 10 Apr 2024 09:43:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a>  Thank you for your offer of help Matt.</p>
<p dir="auto">I think I will stick with version 3.7.12 for now an figure out how to get the system running without the point links. After the recent crash it has highlighted the need to stay more relevant in regards to database versions and Linux versions which also mean we should think about moving towards Mango 5 with a stop over in Mango 4 just to be sure everything is still working. And in no future that we see for the Mango service will point links return. A shame because I found them an easy and simple way to achieve what we needed.</p>
]]></description><link>https://forum.mango-os.com/post/28142</link><guid isPermaLink="true">https://forum.mango-os.com/post/28142</guid><dc:creator><![CDATA[BG]]></dc:creator><pubDate>Wed, 10 Apr 2024 09:43:39 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Tue, 09 Apr 2024 23:23:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bg" aria-label="Profile: BG">@<bdi>BG</bdi></a> feel free to tag me, I can help. Alternatively, let me know what version of mango 3 you need</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/28140</link><guid isPermaLink="true">https://forum.mango-os.com/post/28140</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 09 Apr 2024 23:23:41 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Tue, 09 Apr 2024 16:02:09 GMT]]></title><description><![CDATA[<p dir="auto">Hello All,<br />
The restore process was almost a success.</p>
<p dir="auto">The process went ok. I managed to get the NoSQL back up restored via the legacy pages, the MySQL restored via the new system settings pages and the json configuration imported via the new configuration import/export page.</p>
<p dir="auto">The automatic back ups did not back up the filestore but I happened to have a recent copy of that folder so I was able to restore all of the images I created for my dashboards as well as the excel report templates in use,</p>
<p dir="auto">The only problem I encountered  and it is a major problem for us, is that we had to install 3.7.12 as it is the only Mango 3 option available and that version does not have the Point Links feature.</p>
<p dir="auto">All of our loggers used the Point Link Feature to change a flag data cell on each row of data in the MySQL table after the row was read into Mango.</p>
<p dir="auto">I am now left with trying to figure out how to get the MySQL data row read into Mango using the Scripting Data Source. And I am struggling but I will put that into the forum under a new thread with more details.</p>
<p dir="auto">Cheers<br />
Brian</p>
]]></description><link>https://forum.mango-os.com/post/28139</link><guid isPermaLink="true">https://forum.mango-os.com/post/28139</guid><dc:creator><![CDATA[BG]]></dc:creator><pubDate>Tue, 09 Apr 2024 16:02:09 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Fri, 22 Mar 2024 08:18:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bg" aria-label="Profile: BG">@<bdi>BG</bdi></a> Thank you very much Matt. I will follow your advice.</p>
<p dir="auto">Cheers</p>
<p dir="auto">Brian</p>
]]></description><link>https://forum.mango-os.com/post/28131</link><guid isPermaLink="true">https://forum.mango-os.com/post/28131</guid><dc:creator><![CDATA[BG]]></dc:creator><pubDate>Fri, 22 Mar 2024 08:18:24 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 3.7 restore on Thu, 21 Mar 2024 20:46:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bg" aria-label="Profile: BG">@<bdi>BG</bdi></a> the restore for the sql database will give you all of your system config and internal IDs.<br />
If you're unsure, run another mango instance on another http port to a new database then do the config import. Assuming all is back as desired, you can then update the mango env.properties on your main mango instance to the new db and restart.<br />
It will restore point values if you're not using the nosql db</p>
<p dir="auto">The nosql restore stuff is just point value data.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/28130</link><guid isPermaLink="true">https://forum.mango-os.com/post/28130</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 21 Mar 2024 20:46:46 GMT</pubDate></item></channel></rss>