wbh1 / grafana-sqlite-to-postgres

Grafana SQLite to Postgres Database Migrator
MIT License
97 stars 26 forks source link

sqlite3 problem #14

Closed agn-7 closed 4 years ago

agn-7 commented 4 years ago

Hello

I had a problem during importing a grafana.db to postgresql:

./grafana-migrate_linux grafana.db "postgres://grafana_usr:xxxx@172.17.0.1:5432/grafana_db?sslmode=disable"

Out:

INFO[2020-06-14T16:24:45+04:30] 📁 SQLlite file: grafana.db                   
INFO[2020-06-14T16:24:45+04:30] 📁 Dump directory: /tmp                       
FATAL[2020-06-14T16:24:45+04:30] ❌ exec: "sqlite3": executable file not found in $PATH - is the sqlite3 command line tool installed?

Also, I've done these installations before:

sudo apt-get install gcc
go get -u github.com/mattn/go-sqlite3
go install github.com/mattn/go-sqlite3

[NOTE]:

wbh1 commented 4 years ago

Hi Benyamin,

You have to have sqlite installed on the machine that you're running this tool on. That's why the error message mentions the "command line tool". When you install sqlite, it out to include an executable called "sqlite3".

https://www.sqlitetutorial.net/download-install-sqlite/

agn-7 commented 4 years ago

Thanks for the response, but as I mentioned in my question, I've installed sqlite3 by these commands below:

go get -u github.com/mattn/go-sqlite3
go install github.com/mattn/go-sqlite3
wbh1 commented 4 years ago

Those just install the sqlite driver that can be used by the database/sql golang package. You actually need to install the sqlite command line tools from the sqlite project located here

agn-7 commented 4 years ago

Thank you. But the mentioned link didn't work for me. Instead, I used the following command and the problem was solved:

sudo apt-get install sqlite3