Tag Archives: restore

Postgresql : moving data from windows to linux

I was trying to move my database from Windows server to Linux server. I thought it will be a simple process. But, it is not. It took backup from windows server via pgAdmin III. and tried to restore the backup to linux server via command line.

pg_restore -d dbname -U username -C /home/back1.backup

Then I got peer authentication error. so i fixed my pg_hba.conf file. It was

local   all             all                                     peer

I changed it to

local   all             all                                     trust

Then again I tried to run restore command. I got the following error.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2021; 1262 16483 DATABASE dbname dbname
pg_restore: [archiver (db)] could not execute query: ERROR: invalid locale name: “English_United States.1252”
Command was: CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ‘UTF8’ LC_COLLATE = ‘English_United States.1252’ LC_CTYPE = ‘Engli…
WARNING: errors ignored on restore: 1

Read more of this post

Advertisements