Skip to content

Using pgloader with --context defaults to sqlite #1682

@frague59

Description

@frague59

Hi,

I'm trying to migrate from MySQL (MariaDB) to PostgreSQL, using a context file.

$ cat directory.ini
[pgloader]
MYSQL_DBPATH=mysql://[email protected]::3306/directory
PG_DBPATH=postgresql://[email protected]/directory
DB_NAME=directory

$ cat mysql2pg.load
LOAD DATABASE
      FROM {{ MYSQL_DBPATH }}
      INTO {{ PG_DBPATH }}
  ALTER SCHEMA '{{ DB_NAME }}' RENAME TO 'public';

When using pgloader, the FROM try to resolve the path as a local file and defaults to SQLIte.

$ pgloader --context directory.ini mysql2pg.load
2025-08-26T07:47:15.004000Z LOG pgloader version "3.6.10~devel"
2025-08-26T07:47:15.084000Z LOG Migrating from #<SQLITE-CONNECTION sqlite:///home/fguerin/Projects/postgres-migrations/mysql:/[email protected]::3306/directory.load {1005DD54C3}>
2025-08-26T07:47:15.084000Z LOG Migrating into #<PGSQL-CONNECTION pgsql://[email protected]:5432/directory {1005DD5543}>
2025-08-26T07:47:15.088000Z ERROR sqlite: Failed to open sqlite file #P"/home/fguerin/Projects/postgres-migrations/mysql:/[email protected]::3306/directory.load": Could not open sqlite3 database /home/fguerin/Projects/postgres-migrations/mysql:/[email protected]::3306/directory.load
Code CANTOPEN: no message.
2025-08-26T07:47:15.088000Z LOG report summary reset
       table name     errors       rows      bytes      total time
-----------------  ---------  ---------  ---------  --------------
            fetch          0          0                     0.000s
  fetch meta data          0          0                     0.000s
-----------------  ---------  ---------  ---------  --------------
-----------------  ---------  ---------  ---------  --------------

Version

 pgloader --version
pgloader version "3.6.10~devel"
compiled with SBCL 2.4.9+git20241010.1.465757f12.debian

Any idea ? Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions