peace
11/11/2025, 4:21 AMdocker exec -it <LLDAP container name> /app/lldap create_schema -d <Target database url>
2. Dumped existing data from sqlite to a file ./sqlite_dump_commands.sh | sqlite3 /path/to/lldap/config/users.db > /path/to/dump.sql
3. Sanitized the data for postgres with
sed -i -r -e "s/X'([[:xdigit:]]+'[^'])/'\\\x\\1/g" \
-e ":a; s/(INSERT INTO (user_attribute_schema|jwt_storage)\(.*\) VALUES\(.*),1([^']*\);)$/\1,true\3/; s/(INSERT INTO (user_attribute_schema|jwt_storage)\(.*\) VALUES\(.*),0([^']*\);)$/\1,false\3/; ta" \
-e '1s/^/BEGIN;\n/' \
-e '$aSELECT setval(pg_get_serial_sequence('\''groups'\'', '\''group_id'\''), COALESCE((SELECT MAX(group_id) FROM groups), 1));' \
-e '$aCOMMIT;' /path/to/dump.sql
4. Point lldap container to postgres db using env variable LLDAP_DATABASE_URL
This is when I encounter errors from the container. I believe lldap is trying to so some invalid migrations. Can someone give some pointers on how to solve this?Answer Overflow
11/11/2025, 4:21 AMpeace
11/11/2025, 4:22 AM[entrypoint] Copying the default config to /data/lldap_config.toml
[entrypoint] Edit this file to configure LLDAP.
> Setup permissions..
> Starting lldap..
Loading configuration from /data/lldap_config.toml
WARNING: A key_seed was given, we will ignore the key_file and generate one from the seed! Set key_file to an empty string in the config to silence this message.
2025-11-11T03:47:12.763912758+00:00 INFO set_up_server [ 15.1ms | 100.00% ]
2025-11-11T03:47:12.763938062+00:00 INFO ┝━ i [info]: Starting LLDAP version 0.6.2
2025-11-11T03:47:13.353758460+00:00 INFO ┝━ i [info]: Upgrading DB schema from version 1
2025-11-11T03:47:13.353764048+00:00 INFO ┝━ i [info]: Upgrading DB schema to version 2
2025-11-11T03:47:13.702412795+00:00 INFO ┕━ i [info]: Upgrading DB schema to version 3
Error: while creating base tables
Caused by:
0: Execution Error: error returned from database: column "first_name" does not exist
1: error returned from database: column "first_name" does not exist
2: error returned from database: column "first_name" does not exist
3: column "first_name" does not existpeace
11/11/2025, 4:22 AM2025-11-11 03:47:13.017 UTC [82] ERROR: syntax error at or near "PRAGMA" at character 1
2025-11-11 03:47:13.017 UTC [82] STATEMENT: PRAGMA foreign_keys = ON
2025-11-11 03:47:13.093 UTC [81] ERROR: column "creation_date" of relation "groups" already exists
2025-11-11 03:47:13.093 UTC [81] STATEMENT: ALTER TABLE "groups" ADD COLUMN "creation_date" timestamp without time zone NOT NULL DEFAULT '2025-11-11 03:47:13'
2025-11-11 03:47:13.095 UTC [82] ERROR: column "uuid" of relation "groups" already exists
2025-11-11 03:47:13.095 UTC [82] STATEMENT: ALTER TABLE "groups" ADD COLUMN "uuid" varchar(36) NOT NULL DEFAULT ''
2025-11-11 03:47:13.096 UTC [81] ERROR: column "uuid" of relation "users" already exists
2025-11-11 03:47:13.096 UTC [81] STATEMENT: ALTER TABLE "users" ADD COLUMN "uuid" varchar(36) NOT NULL DEFAULT ''
2025-11-11 03:47:13.704 UTC [81] ERROR: column "first_name" does not existnitnelave
11/11/2025, 7:14 AMnitnelave
11/11/2025, 7:15 AMpeace
11/11/2025, 12:48 PMnitnelave
11/11/2025, 12:54 PMpeace
11/11/2025, 1:01 PMnitnelave
11/11/2025, 1:04 PMnitnelave
11/11/2025, 1:05 PMpeace
11/11/2025, 1:28 PMnitnelave
11/11/2025, 1:29 PMpeace
11/11/2025, 1:37 PMnitnelave
11/11/2025, 1:39 PMnitnelave
11/11/2025, 1:40 PMnitnelave
11/11/2025, 1:40 PMpeace
11/11/2025, 1:42 PMnitnelave
11/11/2025, 1:42 PMnitnelave
11/11/2025, 1:43 PMpeace
11/11/2025, 1:43 PMnitnelave
11/11/2025, 1:43 PMpeace
11/11/2025, 1:44 PMnitnelave
11/11/2025, 1:44 PM