Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 85CB91337BC3 for ; Wed, 12 Jan 2011 18:00:58 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 43823-03 for ; Wed, 12 Jan 2011 22:00:51 +0000 (UTC) X-Greylist: delayed 00:14:10.578629 by SQLgrey-1.7.6 Received: from exprod7og101.obsmtp.com (exprod7og101.obsmtp.com [64.18.2.155]) by mail.postgresql.org (Postfix) with SMTP id 8FC3D133655C for ; Wed, 12 Jan 2011 18:00:49 -0400 (AST) Received: from source ([209.85.218.67]) by exprod7ob101.postini.com ([64.18.6.12]) with SMTP ID DSNKTS4kkOcARj+Gvb0SNuF7hhAC0Rj5DVTx@postini.com; Wed, 12 Jan 2011 14:00:50 PST Received: by yib18 with SMTP id 18so167382yib.6 for ; Wed, 12 Jan 2011 14:00:48 -0800 (PST) Received: by 10.151.50.10 with SMTP id c10mr2655717ybk.175.1294868791277; Wed, 12 Jan 2011 13:46:31 -0800 (PST) Received: from Sivakatirswami.local ([72.253.171.24]) by mx.google.com with ESMTPS id k2sm787181ybj.22.2011.01.12.13.46.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Jan 2011 13:46:29 -0800 (PST) Message-ID: <4D2E2132.2050409@hindu.org> Date: Wed, 12 Jan 2011 11:46:26 -1000 From: Sivakatirswami User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Help with Restoring 8.01 databases to 9.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201101/64 X-Sequence-Number: 36504 I'm in some deep trouble here... We've been running 8.1 on our CentOS 5 linux web server for many years. Not having some of the features of 9.0 was starting to become a serious issue, so I put in an order to the ServerPath data team to upgrade to PostGreSQL 9.0 This worked, was a bit rocky but they did it. Now I'm on my own as their services really are hosting and the OS and when it to higher level things, that falls back on us. First: they they forgot to restore /var/lib/psql/data/pg_hba.conf Of course I had a back up of that and so when I restore it then at least my controlPanel (VirtualMin-WebMin) was able to log into psgl so then I set about try to restore databases from .sql dumps from 8.1 via the command line, I log in su postgres and try: psql -d postgres -f /home/dbase-backups/htde.sql So at first I'm told "role sadhu is missing" so I go to WebMin and create the PostGres user "sadhu and try again.. Now I'm getting the following and at this point I totally do not know what to do next. I tried to restore a few others and most are throwing this duplicate key value violation. Any help will be very much appreciated... psql:/home/dbase-backups/htde.sql:191: ERROR: relation "templates" already exists ALTER TABLE psql:/home/dbase-backups/htde.sql:355726: ERROR: invalid byte sequence for encoding "UTF8": 0x80 CONTEXT: COPY event, line 157477 psql:/home/dbase-backups/htde.sql:355752: ERROR: duplicate key value violates unique constraint "event_type_pkey" DETAIL: Key (event_code)=(AU) already exists. CONTEXT: COPY event_type, line 1: "AU Authenticate. Logged when the user authenticates with the server." psql:/home/dbase-backups/htde.sql:359550: ERROR: duplicate key value violates unique constraint "items_pkey" DETAIL: Key (id)=(1) already exists. CONTEXT: COPY items, line 1: "1 Global Dharma pdf 226 http://www.hinduismtoday.com/archives/2009/7-9/pdf/Hinduism-Today_Jul-Aug-Se..." psql:/home/dbase-backups/htde.sql:359571: ERROR: duplicate key value violates unique constraint "links_pkey" DETAIL: Key (id)=(1) already exists. CONTEXT: COPY links, line 1: "1 Himalayan Academy http://www.himalayanacademy.com Himalayan Academy 2009-11-09 15:31:15" psql:/home/dbase-backups/htde.sql:359811: ERROR: duplicate key value violates unique constraint "magazines_pkey" DETAIL: Key (id)=(224) already exists. CONTEXT: COPY magazines, line 1: "224 2009-01-01 cover_2009-01-01.jpg ? 2009-11-09 15:31:15 2009 1-January/February/March" psql:/home/dbase-backups/htde.sql:372564: ERROR: duplicate key value violates unique constraint "subscriber_pkey" DETAIL: Key (user_id)=(44) already exists. CONTEXT: COPY subscriber, line 1: "44 Anil Badhwar abadhwar@gmail.com Birth month April NO 2006-03-27\N \N 2006-03-27 13:52:49-08 \N \..." psql:/home/dbase-backups/htde.sql:372577: ERROR: duplicate key value violates unique constraint "templates_pkey" DETAIL: Key (title)=(Youtube) already exists. CONTEXT: COPY templates, line 1: "Youtube video/youtube \n\n\n\n
\n
\n