Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009
    Posts
    1

    Exclamation Unanswered: pg_dump pg_restore help

    Hi

    I'm very new to PostgreSQL and need to urgently move a database. I have a VMware running Fedora with an instance of PostgreSQL
    (From here: VMWare image of Mingle)
    Now after a bit of use we need to move it off of the vmware as it's proving unreliable.

    So I have the VM running PostgreSQL 8.3.7 on Fedora and tried the following (the first was recomended by Mingle's support department):
    pg_dump mingle -Umingle -F c -b -v -f 1.backup
    pg_dump mingle -Umingle > 2.backup
    pg_dump mingle -Umingle -F c -b -v -f 3.backup

    And then moved the file to my windows box to try and restore, running PostgreSQL 8.4

    C:/Program Files/PostgreSQL/8.4/bin\pg_restore.exe --host localhost --port 5432 --username postgres --dbname mingle --verbose "C:\1.backup"
    pg_restore: [archiver] unrecognized file format "0"

    C:/Program Files/PostgreSQL/8.4/bin\pg_restore.exe --host localhost --port 5432 --username postgres --dbname mingle --verbose "C:\2.backup"
    pg_restore: [archiver] input file does not appear to be a valid archive

    C:/Program Files/PostgreSQL/8.4/bin\pg_restore.exe --host localhost --port 5432 --username postgres --dbname mingle --verbose "C:\3.backup"
    pg_restore: [archiver] unsupported version (1.13) in file header

    1.backup is 1.8mb, 2.backup is 17mb, 3.backup is slightly bigger than the 2nd.

    I've also tried putting the 8.3/bin folder on my windows box and running it's pg_restore, same results

    What am I doing wrong?
    Last edited by Tonst; 07-21-09 at 08:14.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    The following works for me:

    pg_dump.exe -U postgres -F c -f pagila.bck pagila

    pg_restore.exe -U postgres -d postgres -C pagila.bck pagila

    It's a different order of parameters with pg_dump compared to your examples

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •