dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

getting error ERROR sqlite: Failed to open sqlite file #1580

Open mangeshongit opened 6 months ago

mangeshongit commented 6 months ago

Is it possible migrate mssql onprem database to postgresql database with below scenario:-

suppose we have table name "employee_name" in source database can we migrate that table into "employee_ID" into the target database ?

Tried simple scenario, but that is giving below error. +++++++++++++++++++++++++++++++ cat migrate_sample_table.load LOAD DATABASE FROM mssql://dbuser:dbuserpassword@mssqldatabasehost:2023/sourcedbname INTO postgresql://dbuser:dbuserpassword@postgresqldatabasehost:3306/targetdbname WITH include drop, create tables ; ++++++++++++++ root@ubuntuserver:# pgloader --debug migrate_sample_table.load pgloader version 3.6.3~devel compiled with SBCL 2.1.11.debian sb-impl::default-external-format :UTF-8 tmpdir: #P"/tmp/pgloader/" 2024-04-29T12:16:40.004000Z NOTICE Starting pgloader, log system is ready. 2024-04-29T12:16:40.024000Z INFO Starting monitor 2024-04-29T12:16:40.032000Z LOG pgloader version "3.6.3~devel" 2024-04-29T12:16:40.044000Z INFO Parsed command: LOAD DATABASE FROM mssql://dbuser:dbuserpassword@mssqldatabasehost:2023/sourcedbname INTO postgresql://dbuser:dbuserpassword@postgresqldatabasehost:3306/targetdbname --LOAD TABLE tt3 --FROM dbo.tt3 --INTO tt3_migrated WITH include drop, create tables ;

2024-04-29T12:16:40.096000Z DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://dbuser@postgresqldatabasehost:3306/targetdbname {1007F80A83}> 2024-04-29T12:16:40.096000Z DEBUG SET client_encoding TO 'utf8' 2024-04-29T12:16:40.096000Z DEBUG SET application_name TO 'pgloader' 2024-04-29T12:16:40.116000Z LOG Migrating from #<SQLITE-CONNECTION sqlite:///home/mangesh/test/mssql:/dbuser:dbuserpassword@mssqldatabasehost:2023/sourcedbname.load {1007F7EE83}> 2024-04-29T12:16:40.116000Z LOG Migrating into #<PGSQL-CONNECTION pgsql://dbuser@postgresqldatabasehost:3306/targetdbname {1007F80A83}> 2024-04-29T12:16:40.132000Z ERROR sqlite: Failed to open sqlite file #P"/home/mangesh/test/mssql:/dbuser:dbuserpassword@mssqldatabasehost:2023/sourcedbname.load": Could not open sqlite3 database /home/mangesh/test/mssql:/dbuser:dbuserpassword@mssqldatabasehost:2023/sourcedbname.load Code CANTOPEN: no message. 2024-04-29T12:16:40.132000Z LOG report summary reset table name errors read imported bytes total time read write


        fetch          0          0          0                     0.000s

fetch meta data 0 0 0 0.000s



2024-04-29T12:16:40.172001Z INFO Stopping monitor +++++++++++

jiangxianneng commented 5 months ago

I am encountering the same issue.
Snipaste_2024-05-29_09-54-09

luanfvieira commented 3 months ago

I have the same problem, did you manage to solve it?

latot commented 1 month ago

Me too.

latot commented 1 month ago

I got a clue when this happens, if you use an absolute path for reach the SQLite file, we can get this problem.

Instead move to the filer folder and use a relative path.

Still is no the same as the issue above, but hope it helps.