# Migration Context: Grafana v4 -> v5 # Generated by Changelogs.us: 2026-11-30T03:04:35.899189+00:00 # Target Version: v5.4.5 # Upgrade Command: N/A # Breaking Changes: 5 # Security Fixes: 0 ## Executive Summary Upgrading Grafana from 4 to 5 involves 31 releases with risk rating Moderate. ## Breaking Changes List: - [vv5.3.0] Breaking changes * Postgres datasource no longer automatically adds time column alias when using the $__timeGroup alias. However, there's code in place which should make this change backward compatible and shouldn't create any issues.: - [vv5.4.0] Breaking changes * Postgres/MySQL/MSSQL datasources now per default uses `max open connections` = `unlimited` (earlier 10), `max idle connections` = `2` (earlier 10) and `connection max lifetime` = `4` hours (earlier unlimited).: - [vv6.0.0] Breaking changes * **Internal Metrics** Edition has been added to the build_info metric. This will break any Graphite queries using this metric. Edition will be a new label for the Prometheus metric. [#15363](https://github.com/grafana/grafana/pull/15363): - [vv6.0.0] Breaking changes * **Text Panel**: The text panel does no longer by default allow unsantizied HTML. [#4117](https://github.com/grafana/grafana/issues/4117). This means that if you have text panels with scripts tags they will no longer work as before. To enable unsafe javascript execution in text panels enable the settings `disable_sanitize_html` under the section `[panels]` in your Grafana ini file, or set env variable `GF_PANELS_DISABLE_SANITIZE_HTML=true`. * **Dashboard**: Panel property `minSpan` replaced by `maxPerRow`. Dashboard migration will automatically migrate all dashboard panels u: - [vv6.2.0] Breaking Changes * **Plugins**: Data source plugins that process hidden queries need to add a "hiddenQueries: true" attribute in plugin.json. [#17124](https://github.com/grafana/grafana/pull/17124), [@ryantxu](https://github.com/ryantxu): ## Instructions for AI Assistant: When migrating user code from Grafana 4 to 5, scan for the deprecated APIs and breaking changes above and refactor code to use modern vv5.4.5 idioms.