grafana / grafana/database-migrator

Not able to migrate secrets while migrating from sqlite to PostgreSql

Open
#20 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
126
Forks
15
PR merge metrics
No merged PRs in 30d

Description

psql:postgres_grafana_v2.sql:62753: ERROR: column "encrypted_data" is of type bytea but expression is of type bit
LINE 1: ...a_keys VALUES('P1lrPhq7k',1,'root','secretKey.v1',X'684f4f43...

Please find the line 62753 from the sql file below :
62753 INSERT INTO data_keys VALUES('P1lrPhq7k',1,'root','secretKey.v1',X'684f4f43#####ec09','2022-06-24 22:52:01','2022-06-24 22:52:01','2022-06-24/root@secretKey.v1');

The same is the case for all the secrets. Due to this no user can log in post-migration as above error repeated for all the user accounts

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the generated postgres_grafana_v2.sql at line 62753 and reproduce the SQLite-to-PostgreSQL migration error for the data_keys INSERT. Compare how encrypted_data values are exported with PostgreSQL's bytea expectations. Done means all secret rows migrate without type errors and users can log in after migration.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, shell, sqlite
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.