Thread: Migrate 8.0 dump to 7.4
Hi,
I have a dumpall file generated from a 8.0 version that I need to import back to a 7.4 server.
Is there a way to do that?
a psql -f db.out template1 gives me
psql:/tmp/db.out:687: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:697: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:707: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:717: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:727: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:737: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:747: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:757: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:767: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:777: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:787: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:797: ERROR: syntax error next "INDEX" at character 7
Any idea?
I have a dumpall file generated from a 8.0 version that I need to import back to a 7.4 server.
Is there a way to do that?
a psql -f db.out template1 gives me
psql:/tmp/db.out:687: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:697: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:707: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:717: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:727: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:737: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:747: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:757: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:767: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:777: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:787: ERROR: syntax error next "INDEX" at character 7
ALTER TABLE
psql:/tmp/db.out:797: ERROR: syntax error next "INDEX" at character 7
Any idea?
On 1/21/07, mbneto <mbneto@gmail.com> wrote: > Hi, > > I have a dumpall file generated from a 8.0 version that I need to import > back to a 7.4 server. > > Is there a way to do that? > > a psql -f db.out template1 gives me > psql:/tmp/db.out:687: ERROR: syntax error next "INDEX" at character 7 you must edit your script backup manually in order to match the syntax to that allowed in 7.4 in this case you can go to the line 687 (the line is indicated in psql:/tmp/db.out:line) and fix that syntax... execute again and fix the next message and so on ( a good idea is to put BEGIN; at the beginning of the script and ROLLBACK at the end until you fix all messages)... -- regards, Jaime Casanova "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the universe trying to produce bigger and better idiots. So far, the universe is winning." Richard Cook
On Sun, Jan 21, 2007 at 12:27:41PM -0500, Jaime Casanova wrote: > On 1/21/07, mbneto <mbneto@gmail.com> wrote: > >Hi, > > > >I have a dumpall file generated from a 8.0 version that I need to import > >back to a 7.4 server. > > > >Is there a way to do that? > > > >a psql -f db.out template1 gives me > >psql:/tmp/db.out:687: ERROR: syntax error next "INDEX" at character 7 > > you must edit your script backup manually in order to match the syntax > to that allowed in 7.4 > > in this case you can go to the line 687 (the line is indicated in > psql:/tmp/db.out:line) and fix that syntax... execute again and fix > the next message and so on ( a good idea is to put BEGIN; at the > beginning of the script and ROLLBACK at the end until you fix all > messages)... Trying a dump from the 7.4 version of pg_dump might also work... just make sure to test it. -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
On 21 Jan 2007 at 15:11, Jim C. Nasby wrote: > On Sun, Jan 21, 2007 at 12:27:41PM -0500, Jaime Casanova wrote: > > On 1/21/07, mbneto <mbneto@gmail.com> wrote: > > >Hi, > > > > > >I have a dumpall file generated from a 8.0 version that I need to import > > >back to a 7.4 server. > > > > > >Is there a way to do that? > > > > > >a psql -f db.out template1 gives me > > >psql:/tmp/db.out:687: ERROR: syntax error next "INDEX" at character 7 > > > > you must edit your script backup manually in order to match the syntax > > to that allowed in 7.4 > > > > in this case you can go to the line 687 (the line is indicated in > > psql:/tmp/db.out:line) and fix that syntax... execute again and fix > > the next message and so on ( a good idea is to put BEGIN; at the > > beginning of the script and ROLLBACK at the end until you fix all > > messages)... > > Trying a dump from the 7.4 version of pg_dump might also work... just > make sure to test it. One more option that may work. Instead of using a dumpall do a schema-only dump from 8.0. Apply that to the 7.4 version, fixing the script as needed. Then do a data-only dump from 8.0 and restore into the empty DB on 7.4. The schema-only file will be much smaller and easier to work with than a dumpall file, and the data-only portion should work fine even when regressing. If the 7.4 dump program works against the 8.0 DB then that method should be fine as well.