Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Database Backup

Expand
titleWindows
  • Stop the previous version of Grafana running on the instance and change the start type as Manual

  • Follow the below steps to backup existing database

    • Navigate to <postgres_installation_path>/bin

    • Backup DB using by executing the command pg_dump --username=username --password=password grafana > grafana_backup

Info

To Restore Database - psql grafana < grafana_backup

...

Database Backup

...

Expand
titleWindows
  • Stop the previous version of Grafana running on the instance and change the start type as Manual

  • Follow the below steps to backup existing database

    • Navigate to <postgres_installation_path>/bin

    • Backup DB using by executing the command pg_dump --username=username --password=password grafana > grafana_backup

Info

To Restore Database - psql grafana < grafana_backup

Grafana Migration

Singlestat and Table plugins are removed in grafana
Expand
titleDeprecated plugins
Linux
  • Stop the previous version of Grafana running on the instance

  • Follow the below steps to backup existing database

    • Navigate to <postgres_installation_path>/bin

    • Backup DB using by executing the command pg_dump --username=username --password=password grafana > grafana_backup

Info

To Restore Database - psql grafana < grafana_backup

Grafana Migration

...

Expand
titleDeprecated plugins
  • Singlestat and Table plugins are removed in grafana 7.X

  • Singlestat is replaced with Stat; Stat is a Grafana native plugin which has more features than Singlestat

  • Table plugin is replaced with Newtable plugin

Please Note Newtable plugin doesnot have pagination in it

Expand
titleGrafana DataSource

Grafana now has two Neo4j DataSource

  • Neo4j

  • Neo4jDataSource(Latest) - Built by React

  • Both these data source will work fine in Grafana 7.X but any feature improvements will be added only to Neo4jDataSource. So it is Recommended to use the latest DataSource Neo4jDataSource for Grafana Migration
Expand
titleDashboard Migration
Code Block

Grafana dashboards are backward compatible which can be exported from previous version of Grafana and imported into Garfana 7.X by doing the following changes in the exported json file

Export Dashboards
Info

There are two data formats in Grafana 7.X Table and Graph. Either of one should be selected based on the panel preference

  • Export Dashboards as json file from the previous Grafana version

  • change the following fields inside targets array of export json file

    • target” to “queryText

    • rawQuery” to “table

    • “hide”: true to “hide”: false” to “queryText

    • rawQuery” to “table

    • “hide”: true to “hide”: false

Exported Dashboard json file

Compatible changes for Grafana 7.X

Code Block
languagejson
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 371,
  "links": [],
  "panels": [
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "Neo4j_Local",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "checkQuery": false,
          "hide": true,
          "rawQuery": true,
          "refId": "A",
          "table": true,
          "target": "MATCH (n:ALM)  RETURN count(n)",
          "timeSeries": true
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Panel Title",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    }
  ],
  "schemaVersion": 18,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "New dashboard Copy",
  "uid": "q2Sdbc7Mz",
  "version": 4
}
Code Block
languagejson
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 371,
  "links": [],
  "panels": [
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "Neo4j_Local",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "checkQuery": false,
          "hide": false,
          "table": true,
          "refId": "A",
          "table": true,
          "queryText": "MATCH (n:ALM)  RETURN count(n)",
          "timeSeries": true
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Panel Title",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    }
  ],
  "schemaVersion": 18,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "New dashboard Copy",
  "uid": "q2Sdbc7Mz",
  "version": 4
}

If the panel is a graph panel then mark table as false and mark graph as true

  • “table: false,
    ”graph”: true,

371 [ {cacheTimeoutnullcolorBackgroundfalsecolorValuefalse,colors[#299c46rgba(237, 129, 40, 0.89)"#d44a3a]datasource"Neo4j_Local"format "none",gauge{maxValue100minValue0showthresholdLabelsthresholdMarkers}, gridPos{h 9,w12 x0 y0}id2intervalnulllinks[]mappingType1mappingTypes { name"value to text", value1}, name"range to text"value2} ], "maxDataPoints": 100,nullPointModeconnectednullText null, "postfix": ""postfixFontSize"50%","prefix":"","prefixFontSize": "50%"rangeMaps[{from"" textN/A to"null"} ], sparkline{fillColorrgba(31, 118, 189, 0.18)", "full": false lineColorrgb(31, 120, 193) showfalse}tableColumntargets[{ checkQueryfalse,hidetrue, "rawQuery": true,refIdAtabletruetarget"MATCH (n:ALM) RETURN count(n)"timeSeriestrue}],thresholds"","timeFrom":null"timeShift": null,titlePanel Titletype"singlestat"valueFontSize"80%"valueMaps[ {op"=","text":"N/A",value "null"}], "valueName": "avg"6hq2Sdbc7Mz4 { "builtIn": 1, "datasource":"--Grafana--", "enable": true, "hide": true,iconColor"rgba(0, 211, 255, )"nameAnnotations&Alertstype"dashboard" } ]}, editable"gnetId": null,graphTooltipid":371,"links": [],panels[{cacheTimeout:null,"colorBackground":false,colorValuefalsecolors[ "#299c46" "rgba(237, 129, 40, 0.89)""#d44a3a" ]datasource"Neo4j_Local"format"none"gauge{ maxValue100 minValue0 showfalse,thresholdLabelsfalsethresholdMarkerstrue },gridPos{h9,w12 x0,y0 }, id2intervalnulllinks[]mappingType1mappingTypes[{ name"valuetotext",value1 } {name"range to text",value2}maxDataPoints100nullPointMode"connected"nullTextnullpostfix"","postfixFontSize":"50%",prefix"",prefixFontSize"50%",rangeMaps[{fromnull", "text": "N/A"to"null"sparkline{ fillColor"rgba(31, 118, 189, 0.18)" fullfalse lineColorrgb(31, 120, 193)",showfalse}, tableColumn""targets[{checkQueryfalse, hidefalse tabletrue refId"A" table queryText": "MATCH (n:ALM) RETURN count(n)",timeSeriestrue}], thresholdstimeFromnull,timeShiftnulltitle "Panel Title",type"singlestat"valueFontSize"80%","valueMaps": [op=text"N/A"value"null"}],valueName"avg"}],schemaVersion18,"style":"dark","tags":[], "templating": {"list":[},time"from":"now-6h", to"now" }"timepicker":{refresh_intervals["5s","10s"30s1m, 5m", 15m,30m 1h, 2h, 1d ],time_options:[ 5m15m1h6h12h24h2d7d30d},"timezone":"title": "New dashboard Copy"uid":"q2Sdbc7Mz",version": 4 }

Exported Dashboard json file

Compatible changes for Grafana 7.X

Code Block
languagejson
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 
316,
  "links": [],
  "panels": [
    {
      "aliasColors":
 {},
      "bars": false,
      "dashLength": 10,
      
"dashes": false,
      "
datasource": 
"Neo4j_Local",
      "
fill": 
1,
      "
gridPos": 
{
        "
h": 
12,
        "
w": 12,
        "
x": 0,
        "
y": 0
      
},
      "
id": 
4,
      "
legend":
 {
        "
avg": 
false,
        "
current": 
false,
        "
max": 
false,
        "
min": false,
        "
rightSide": false,
        "
show": true,
      
  
"
total": 
false,
        "
values":
 false
      },
      "
lines": 
true,

      
"
linewidth": 
1,
      
"
links": 
[],
      
"nullPointMode": "null",
      "
percentage": 
false,
      "
pointradius": 
5,
      "
points": 
true,
      "
renderer": 
"flot",
      "
seriesOverrides": [],
      
"spaceLength": 10,
      
"
stack": 
false,
      
"
steppedLine": 
false,
      "targets": [
        
{
          "
checkQuery": 
false,
          "
graph": 
false,
        
  
"rawQuery": true,
          "
refId": "
A",
          "
target":
 "MATCH (n:MaturityTrend) RETURN n.inSightsTime as Time, n.vectorValue as MaturityValue order by Time",
          "
timeSeries": 
true
      
 
 }
     
 ],
      "
thresholds": [],
  
    "timeFrom": null,
   
   "timeRegions": [],
      "
timeShift": 
null
,
      
"
title": "
Consolidated Trend",

      
"
tooltip": 
{
        
"shared": true,
     
   
"
sort": 
0,
        "
value_type": "
individual"
      
},
      
"
type": "
graph",
      
"
xaxis": {
        "buckets": 
null,
        "
mode": "time",
        "
name": 
null,
        
"show": true,
        "
values": 
[]
      },
      "
yaxes": 
[
        
{
          "
format": "
short",
          "
label": 
"Maturity Value",
          "
logBase": 
1,
          "
max": 
null,
        
  "min": null,
   
       "
show": 
true
       
 
},
      
  {
          "
format": "
short",
          "
label": 
null,
          "
logBase": 
1,
          "
max": null,
  
        
"min": null,
          "
show": 
true
        }
 
 
    ],
      "
yaxis":
 {
        "align": false,
 
       
"alignLevel": null
     
 }
    }
  ],
  "schemaVersion": 18,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-
2y",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "New dashboard Copy",
  "uid": "
jEgKHn9ik",
  "version": 
11
}
Code Block
languagejson
{
  "annotations": {
    "list": [

 
 
 
 
  {
        "
builtIn": 
1
,
        "
datasource": "
-- 
Grafana 
--",
        "
enable": 
true,
   
   
  
"
hide": true,
  
      "
iconColor": "rgba(0, 211, 255, 1)"
,
   
     "
name": 
"Annotations & Alerts",
  
      "type": "
dashboard"

  
    }
  
 
 ]
  },
  "
editable": 
true,
  "gnetId": null,
  "
graphTooltip": 
0,
  
"id": 316,
  
"links": [],
  "panels": [
    
{
      
"aliasColors": {},
      "
bars": 
false,
      "
dashLength": 
10,
      "
dashes": 
false,
      
"
datasource": 
"Neo4j_Local",
      
"
fill": 
1,
      
"
gridPos": 
{
        "
h": 
12,
        "
w": 
12,
 
       "
x": 
0,
        "
y": 0
      },
      "
id": 
4,

      
"
legend": 
{
        "
avg": 
false,
   
     
"
current": 
false,
        "
max": 
false,
        "
min": 
false,
        "
rightSide": 
false,
        "
show": 
true,
        
"total": false,
        "
values": false
 
 
    },
      "
lines": 
true,
      
"linewidth": 1,
      "links": 
[],
      "nullPointMode": "null",
      "
percentage": 
false,
      "pointradius": 5,
      "
points": 
true,
      "renderer": "flot",
      "seriesOverrides": [],
      "
spaceLength": 
10,
      "
stack": 
false,
      "
steppedLine": 
false,
      "
targets": 
[
        {
  
 
       "
checkQuery": 
false,
          "
graph": 
true,
          "
table": 
false,
          
"refId": "A",
          "
queryText": "
MATCH (n:MaturityTrend) RETURN n.inSightsTime as Time, n.vectorValue as MaturityValue order by Time",
          "
timeSeries": 
true
        }
      ],
      "
thresholds": 
[],
      "
timeFrom": 
null,
      "timeRegions": [],
      
"
timeShift": 
null,

      
"
title": "
Consolidated Trend",
      "tooltip": {
        "
shared": 
true,
      
  
"
sort": 
0,
        "
value_type": "individual"
      },
   
   "type": "graph",
      "
xaxis": 
{
        
"
buckets": 
null,
        
"
mode": 
"time",
        
"
name": 
null,
        
"
show": true,

        
"
values": []
      },
      "
yaxes": 
[
        
{
      
    "
format": "short",
          "
label": "Maturity 
Value",
          "
logBase": 
1,
          "
max":
 null,
          "
min": 
null,
          "
show": true
       
 },
        {
          "
format": "
short",
          "
label": 
null,
          "
logBase": 
1,
        
  "max": null,
   
       "
min": 
null,
    
   
   "
show": 
true
  
 
   
 
 }
     
 
],
  
    "
yaxis": {
    
 
   
"
align": 
false,
  
 
     "
alignLevel": null
      }
    }
  
],
  "schemaVersion": 18,
  "style": "
dark",
  "tags": [],
  "
templating"
: 
{
    "
list": []
  
},
  "
time"
: {
    "from": "
now-2y",
    "to": 
"
now"

  },
  
"
timepicker"
: 
{
    "
refresh_intervals": [
 
     "
5s"
,
      
"
10s",
      "
30s",
      "
1m",
      "
5m",
      "
15m",
      "
30m",
      "
1h",
      "
2h",
      "
1d"
    ],
    "time_options": [
 
    
 "5m",
  
    "15m",
  
 
   "

Export Dashboards as json file from the previous Grafana version

  • change the following fields inside targets array of export json file

    • target” to “queryText

    • rawQuery” to “table

    • “hide”: true to “hide”: false

1h",
      "
targets
6h"
:
,
[
      "12h",
  
{
    "24h",
      "
checkQuery
2d"
: false
,
      
"
hide
7d"
: false
,

      
"
table
30d"
:

true,
    ]
  },
  
"
refId
timezone": "
A
",
  "title": "New dashboard 
Copy",
  "
queryText
uid": "
<query>
jEgKHn9ik",
  
} ],
"version": 11
}