Schema backup und Wiederherstellen in neuer Datenbank
Gunnar Oehmichen <[email protected]> Thu, 14 Nov 2013 14:20:02 +0100
| Newsgroups | gmane.comp.db.postgresql.german |
|---|---|
| Message-ID | <[email protected]> |
Hallöchen, folgendes Problem gerade. Ich habe eine PostgisDatenbank, Datentabellen sind in einem extra Schema OSM_Data. Ich wollte die Daten auf einen externen Server in eine bereits bestehende Datenbank laden. Um Probleme durch unterschiedliche PostGIS versionen zu vermeiden und nicht die ganzen PostGIS funktionen ebenfalls zu dumpen, dachte ich, es sei besser nur das Schema "OSM_Data" zu sichern Lokale Maschine: Distributor ID: Ubuntu Description: Ubuntu 12.04.3 LTS Release: 12.04 Codename: precise Postgresql Source: postgresql-common (129ubuntu1) Version: 9.1+129ubuntu1 Depends: postgresql-9.1 Postgis 2.0.1-2~precise3 Mit PGAdmin3 erstelle ich den Dump von meiner lokalen Maschine: /usr/bin/pg_dump --host localhost --port 5432 --username "postgres" --no-password --format tar --no-privileges --verbose --file ".../OSM_Oberrhein.backup" --schema "osm_data" "OSM_Oberrhein.backup" pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: reading extensions pg_dump: reading user-defined functions pg_dump: reading user-defined types pg_dump: reading procedural languages pg_dump: reading user-defined aggregate functions pg_dump: reading user-defined operators pg_dump: reading user-defined operator classes pg_dump: reading user-defined operator families pg_dump: reading user-defined text search parsers pg_dump: reading user-defined text search templates pg_dump: reading user-defined text search dictionaries pg_dump: reading user-defined text search configurations pg_dump: reading user-defined foreign-data wrappers pg_dump: reading user-defined foreign servers pg_dump: reading default privileges pg_dump: reading user-defined collations pg_dump: reading user-defined conversions pg_dump: reading type casts pg_dump: reading table inheritance information pg_dump: finding extension members pg_dump: finding inheritance relationships pg_dump: reading column info for interesting tables pg_dump: finding the columns and types of table "planet_osm_point" pg_dump: finding default expressions of table "planet_osm_point" pg_dump: finding the columns and types of table "planet_osm_roads" pg_dump: finding default expressions of table "planet_osm_roads" pg_dump: finding the columns and types of table "planet_osm_line" pg_dump: finding default expressions of table "planet_osm_line" pg_dump: finding the columns and types of table "planet_osm_polygon" pg_dump: finding default expressions of table "planet_osm_polygon" pg_dump: finding the columns and types of table "streets_landau_3857" pg_dump: flagging inherited columns in subtables pg_dump: reading indexes pg_dump: reading indexes for table "planet_osm_point" pg_dump: reading indexes for table "planet_osm_roads" pg_dump: reading indexes for table "planet_osm_line" pg_dump: reading indexes for table "planet_osm_polygon" pg_dump: reading constraints pg_dump: reading triggers pg_dump: reading rewrite rules pg_dump: reading dependency data pg_dump: saving encoding = UTF8 pg_dump: saving standard_conforming_strings = on pg_dump: dumping contents of table planet_osm_line pg_dump: dumping contents of table planet_osm_point pg_dump: dumping contents of table planet_osm_polygon pg_dump: dumping contents of table planet_osm_roads Prozess beendete mit Exitcode 0. Daraufhin habe ich also die .backup datei (2.8 Gb) auf den Server kopiert. Externer Server: Distributor ID: Ubuntu Description: Ubuntu 12.04.3 LTS Release: 12.04 Codename: precise Postgresql Source: postgresql-common (129ubuntu1) Version: 9.1+129ubuntu1 Depends: postgresql-9.1 Postgis 2.0.2 Auf dem Server greife ich mittels PGAdmin3 (Installation auf dem Server) ebenfalls auf das Backup zu. Ich habe zuvor ein neues Schema "OSM_data" in einer bereits vorhandenen Datenbank erstellt /usr/bin/pg_restore --host localhost --port 5432 --username "oehmichen" --dbname "gisdata" --no-password --schema-only --schema \"OSM_data\" --verbose ".../OSM_Oberrhein.backup" pg_restore: connecting to database for restore pg_restore: implied data-only restore Prozess beendete mit Exitcode 0. Und ebenfalls: /usr/bin/pg_restore --host localhost --port 5432 --username "oehmichen" --dbname "gisdata" --no-password --data-only --schema \"OSM_data\" --verbose "/home/gisroot/INSERT/OSM_Oberrhein.backup" pg_restore: connecting to database for restore Prozess beendete mit Exitcode 0. Nach beiden Versuchen ist im Schema und der Datenbank nichts passiert. Beste GrüÃe und herzlichen Dank, Gunnar -- Gunnar Oehmichen Quantitative Landscape Ecology Institute for Environmental Sciences University Koblenz-Landau Fortstrasse 7 76829 Landau Germany http://www.uni-koblenz-landau.de/landau/fb7/umweltwissenschaften/landscape-ecology/Staff/gunnaroehmichen -- Sent via pgsql-de-allgemein mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-de-allgemein