I'm using pgloader to migrate data from SQL Server to PostgreSQL server, the database is huge and I can't export to CSVv due to special characters. So I migrate db to db directly, almost done but it gets stuck at columns that have ñ/í/... data, and everything breaks. If I remove all above characters, then everything is good again, below is my setup .load script:
-- Single Table Migration Template: Data Only, No Drop Table
-- Replace: HOST_IP, username, password, database names, and TABLE_NAME as needed
LOAD DATABASE
FROM mssql://sa:[email protected]/ADB
INTO postgresql://postgres:[email protected]/ADB
-- Performance and migration settings
WITH
data only, -- Only copy data, don't drop or create tables
disable triggers,
no foreign keys,
quote identifiers,
batch rows = 50000,
prefetch rows = 10000
CAST
type varchar TO text ,
type nvarchar TO text,
type text TO text
SET
client_encoding = 'WIN1252',
work_mem to '256MB',
maintenance_work_mem to '1GB'
ALTER SCHEMA 'dbo' RENAME TO 'public'
INCLUDING ONLY TABLE NAMES LIKE 'DRecords' IN SCHEMA 'dbo'
BEFORE LOAD DO
$$ SET session_replication_role = replica; $$
AFTER LOAD DO
$$ SET session_replication_role = DEFAULT; $$;
It used to work well when running inside docker desktop for windows, but windows server does not support docker desktop. The error message contains:
7: ((FLET "H1" :IN PGLOADER.SOURCES:MAP-ROWS) #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {10082879B3}>) 8: (SB-KERNEL::%SIGNAL #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE {10082879B3}>) 9: (ERROR BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE :OCTETS #(176) :ENCODING :UTF-8 :BUFFER #.(SB-SYS:INT-SAP #X72DEDC01FB60) :POSITION 252) 10: ((LABELS BABEL-ENCODINGS::UTF-8-DECODER :IN
Can someone please advise.