# Migration sqlite to PostgreSQL

**URL:** <https://community.grafana.com/t/migration-sqlite-to-postgresql/10393>\
**Category:** Grafana\
**Created:** [September 12, 2018, 2:40pm UTC](https://community.grafana.com/t/migration-sqlite-to-postgresql/10393 "2018-09-12T14:40:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grizzlynet](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@grizzlynet](https://community.grafana.com/u/grizzlynet)\
**Post date:** [September 12, 2018, 2:40pm UTC](https://community.grafana.com/t/migration-sqlite-to-postgresql/10393/1 "2018-09-12T14:40:21Z")

</div>

Hi,  
i moved the database from SQLITE to POSTGRESQL using pgloader. Migration was successful.  
But now i see the error in the log file :

t=2018-09-12T11:43:10+0300 lvl=eror msg=“Failed to get system stats” logger=metrics error=“pq: invalid input syntax for integer: "true"”

What it means ?

---

<div class="post-metadata">

**Author:** ![grizzlynet](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@grizzlynet](https://community.grafana.com/u/grizzlynet)\
**Post date:** [September 19, 2018, 1:15pm UTC](https://community.grafana.com/t/migration-sqlite-to-postgresql/10393/2 "2018-09-19T13:15:52Z")

</div>

> [@grizzlynet](#):
>
> Failed to

Can anyone help ? How can fix it ?

---

<div class="post-metadata">

**Author:** ![qhartman](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/qhartman/32/6015_2.png) [@qhartman](https://community.grafana.com/u/qhartman)\
**Post date:** [February 5, 2019, 10:46pm UTC](https://community.grafana.com/t/migration-sqlite-to-postgresql/10393/3 "2019-02-05T22:46:04Z")

</div>

I appears that when migrating from sqlite to postgres, certain columns need to be cast to booleans (SQLite has no dedicated boolean type) so there is no totally direct way to do this. I’m going to try to come up with a tool to do it. I will link it here if/ when that happens.

---

<div class="post-metadata">

**Author:** ![vindya101010](https://avatars.discourse-cdn.com/v4/letter/v/ba8739/32.png) [@vindya101010](https://community.grafana.com/u/vindya101010)\
**Post date:** [February 22, 2024, 8:52pm UTC](https://community.grafana.com/t/migration-sqlite-to-postgresql/10393/4 "2024-02-22T20:52:44Z")

</div>

@qhartman , I am facing the same issue after migration from sqlite to postgressql through pgloader. Is there any solution or tool for this to resolve? or do I need to make changes manually?

---

<div class="post-metadata">

**Author:** ![qhartman](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/qhartman/32/6015_2.png) [@qhartman](https://community.grafana.com/u/qhartman)\
**Post date:** [February 22, 2024, 9:05pm UTC](https://community.grafana.com/t/migration-sqlite-to-postgresql/10393/5 "2024-02-22T21:05:25Z")

</div>

Man, this was a long time ago. I did ultimately overcome the problem, but I don’t recall the solution exactly. I expect I dumped the data out of sqlite and wrote a throwaway script to coerce the necessary data to booleans. Sorry I can’t be of more help.
