Re:Re:Exportar e Importar una BD

Inicio Foros Foro principal Instalación y Configuración Exportar e Importar una BD Re:Re:Exportar e Importar una BD

#35446
Roberto Ramos
Miembro

Federico

He seguido los pasos siguientes, y no funciona.

1.abro el pgadmin en la maquina donde esta la base que quiero sacar. La base se llama “libertya”
exportabd01.jpg

2. boton derecho del mouse en la base “libertya” y elijo la opcion “resguardo”
exportabd02.jpg

3. se abre el cuadro de dialogo, selecciono el nombre del backup “D:libertya_bak.backup”, formato “compress” y OK
exportabd03.jpg

el log:
C:Archivos de programaPostgreSQL8.3binpg_dump.exe -h localhost -p 5432 -U postgres -F c -v -f “D:libertya_bak.backup” libertya
pg_dump: reading schemas
pg_dump: reading user-defined functions
pg_dump: reading user-defined types


pg_dump: dumping contents of table jar_repository
pg_dump: dumping contents of table typemap_entry

El proceso retornó el código de salida 0.

Me llevo el backup a otra maquina, donde instale un Libertya vacío (bases vacias, en realidad la original de instalacion). En las dos maquinas esta instalada la misma version (10.09). Como diferencias, en la maquina donde estan los datos que quiero exportar, el jdk y el postgre estan instalados en C:Archivos de Programa, y la carpeta ServidorOXP en el raíz del disco C:. En la maquina “destino” (donde quiero hacer funcionar la base q estoy exportando) todas las carpetas (jdk, postgre y servidoroxp) estan en el raíz del disco D:

Vamos a la maquina destino.
1. Abro el pgadmin y busco la base “libertya” (tiene el mismo nombre y el mismo pass q en la maquina original)
exportabd04.jpg

2. boton derecho del mouse en la base “libertya” y elijo la opcion “restaurar”
exportabd06.jpg

3. se abre el cuadro de dialogo, selecciono el nombre del backup “D:libertya_bak.backup”, y OK
exportabd05.jpg

y vienen las malas…
En VISTA aparentemente esta todo bien

D:PostgreSQL8.3binpg_restore.exe -h localhost -p 5432 -U postgres -d libertya -l “D:libertya_bak.backup”
;
; Archive created at Tue Jan 18 18:23:02 2011
; dbname: libertya
; TOC Entries: 5504
; Compression: -1
; Dump Version: 1.10-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 8.3.8
; Dumped by pg_dump version: 8.3.8
;
;
; Selected TOC Entries:
;
8; 2615 16482 SCHEMA – libertya libertya
3; 2615 2200 SCHEMA – public postgres
……

10461; 2606 16436 FK CONSTRAINT sqlj jar_entry_jarid_fkey postgres
10460; 2606 16441 FK CONSTRAINT sqlj jar_repository_deploymentdesc_fkey postgres

El proceso retornó el código de salida 0.

Pero cuando le doy OK al restore:

D:PostgreSQL8.3binpg_restore.exe -h localhost -p 5432 -U postgres -d libertya -v “D:libertya_bak.backup”
pg_restore: connecting to database for restore
pg_restore: creating SCHEMA libertya
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 8; 2615 16482 SCHEMA libertya libertya
pg_restore: [archiver (db)] could not execute query: ERROR: schema “libertya” already exists
Command was:
CREATE SCHEMA libertya;
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating SCHEMA sqlj
pg_restore: [archiver (db)] Error from TOC entry 6; 2615 16405 SCHEMA sqlj postgres
pg_restore: [archiver (db)] could not execute query: ERROR: schema “sqlj” already exists
Command was: CREATE SCHEMA sqlj;
….
….. Siguen errors similares
….
pg_restore: creating FUNCTION acctbalance(numeric, numeric, numeric)
pg_restore: [archiver (db)] Error from TOC entry 34; 1255 16484 FUNCTION acctbalance(numeric, numeric, numeric) libertya
pg_restore: [archiver (db)] could not execute query: ERROR: function “acctbalance” already exists with same argument types
Command was: CREATE FUNCTION acctbalance(p_account_id numeric, p_amtdr numeric, p_amtcr numeric) RETURNS numeric
AS $$

BEGIN

RE…
pg_restore: creating FUNCTION activate_locale_ar(boolean)
pg_restore: [archiver (db)] Error from TOC entry 35; 1255 16485 FUNCTION activate_locale_ar(boolean) libertya
pg_restore: [archiver (db)] could not execute query: ERROR: function “activate_locale_ar” already exists with same argument types
Command was: CREATE FUNCTION activate_locale_ar(activar boolean) RETURNS integer
AS $$
DECLARE
tabla_c_bpartner_id integer;
t…
….
….. Siguen errors similares
….
pg_restore: creating TABLE ad_element_trl
pg_restore: [archiver (db)] Error from TOC entry 3910; 1259 17039 TABLE ad_element_trl libertya
pg_restore: [archiver (db)] could not execute query: ERROR: relation “ad_element_trl” already exists
Command was: CREATE TABLE ad_element_trl (
ad_element_id integer NOT NULL,
ad_language character varying(6) NOT NULL,
ad_clie…
….
….. Siguen errors similares
….
pg_restore: restoring data for table “a_registrationvalue”
pg_restore: restoring data for table “ad_accesslog”
pg_restore: restoring data for table “ad_alert”
pg_restore: [archiver (db)] Error from TOC entry 12613; 0 16719 TABLE DATA ad_alert libertya
pg_restore: [archiver (db)] COPY failed: ERROR: duplicate key value violates unique constraint “ad_alert_key”
CONTEXT: COPY ad_alert, line 1: “100 0 0 Y 2004-09-03 00:00:00 0 2006-11-06 16:36:36 100 Espacio en la base de datos N N Database S…”
pg_restore: restoring data for table “ad_alertprocessor”
pg_restore: [archiver (db)] Error from TOC entry 12614; 0 16731 TABLE DATA ad_alertprocessor libertya
pg_restore: [archiver (db)] COPY failed: ERROR: duplicate key value violates unique constraint “ad_alertprocessor_key”
CONTEXT: COPY ad_alertprocessor, line 1: “100 0 0 Y 2004-03-06 00:00:00 0 2010-03-23 11:49:12.722 0 System Alert Processor N M 1 2010-03-23 1…”
pg_restore: restoring data for table “ad_alertprocessorlog”
….
….. Siguen errors similares
….
pg_restore: restoring data for table “typemap_entry”
pg_restore: creating CONSTRAINT a_asset_acct_pkey
pg_restore: [archiver (db)] Error from TOC entry 8995; 2606 281991 CONSTRAINT a_asset_acct_pkey libertya
pg_restore: [archiver (db)] could not execute query: ERROR: multiple primary keys for table “a_asset_acct” are not allowed
Command was: ALTER TABLE ONLY a_asset_acct
ADD CONSTRAINT a_asset_acct_pkey PRIMARY KEY (a_asset_id, c_acctschema_id);
pg_restore: creating CONSTRAINT a_asset_addition_pkey
pg_restore: [archiver (db)] Error from TOC entry 8997; 2606 281993 CONSTRAINT a_asset_addition_pkey libertya
pg_restore: [archiver (db)] could not execute query: ERROR: multiple primary keys for table “a_asset_addition” are not allowed
Command was: ALTER TABLE ONLY a_asset_addition
ADD CONSTRAINT a_asset_addition_pkey PRIMARY KEY (a_asset_addition_id);
….
….. Siguen errors similares
….
pg_restore: creating INDEX c_invoiceline_invoice
pg_restore: [archiver (db)] Error from TOC entry 9658; 1259 283348 INDEX c_invoiceline_invoice libertya
pg_restore: [archiver (db)] could not execute query: ERROR: relation “c_invoiceline_invoice” already exists
Command was: CREATE INDEX c_invoiceline_invoice ON c_invoiceline USING btree (c_invoice_id);
pg_restore: creating INDEX c_invoiceline_orderline
pg_restore: [archiver (db)] Error from TOC entry 9661; 1259 283349 INDEX c_invoiceline_orderline libertya
pg_restore: [archiver (db)] could not execute query: ERROR: relation “c_invoiceline_orderline” already exists
Command was: CREATE INDEX c_invoiceline_orderline ON c_invoiceline USING btree (c_orderline_id);
….
….. Siguen errors similares
….
pg_restore: setting owner and privileges for FK CONSTRAINT classpath_entry_jarid_fkey
pg_restore: setting owner and privileges for FK CONSTRAINT jar_entry_jarid_fkey
pg_restore: setting owner and privileges for FK CONSTRAINT jar_repository_deploymentdesc_fkey
WARNING: errors ignored on restore: 4701

El proceso retornó el código de salida 1.

Perdona lo extenso del post, pero necesito encontrar una solucion.
Intente tambien ejecutar los comandos pg_dump y pg_restore desde la linea de comandos, con los mismos resultados.

Una cosa mas: en una pc tengo libertya corriendo bajo WINXP (la q tiene la data) y donde quiero llevar esa info esta una instalacion libertya sobre Win7. (entiendo que deberia ser lo mismo, pero aclaro por las dudas).

Bueno, agradecere tu ayuda o del foro en general. Desde ya, muchas gracias.