Closed jgould22 closed 4 years ago
Hey Jordan, I will look into this. I hadn't tested with a Grafana that is used for alerting, personally.
@jgould22 I was able to import alerts & annotations without issue, just now. Could you send me one or two of the failing alerts/annotations from the /tmp/grafana.sql
dump?
Hey Will, So I had a look at the grafana.sql and the failing annotations seems to be failing when encountering a \n
Here is an example of a failing annotation as it appears in /tmp/grafana.sql
INSERT INTO "annotation" VALUES(49,1,0,3,15,6,NULL,'','','IPs
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32
127.0.0.1/32',NULL,'','','',1548796008492,0,'["tag","global"]',1548798001194,1548860046794,1548796008492);
Ah, yeah... That'll do it. Currently I separate the SQL statements to be run by splitting on new lines (ref).
I'll see if there's a better way to do this with the database drivers I'm using, or if I need to sanitize the input differently.
I have updated this and cut a new release. Can you test it and confirm it works now?
Hey Will, I tried the new release and everything went well without issue.
Thanks for the help and the migration tool!
@jgould22 glad to hear it! Thanks for helping me pinpoint the issue.
When attempting to import a Grafana sqlite3 db to Postgres 12 I have twice encountered the same bug
There were only a cuple alerts so I removed them but the same error seems to occur on what appears to be annotations now
Unfortunately there are far more annotations and it isnt feasible for me to recreate them
Any help is greatly appreciated