public inbox for [email protected]  
help / color / mirror / Atom feed
From: Keith <[email protected]>
To: Killian Driscoll <[email protected]>
To: PGSQL-Novice <[email protected]>
Subject: Re: Open version 9.3 .out file with version 12
Date: Tue, 15 Sep 2020 12:27:22 -0400
Message-ID: <CAHw75vsX-ww6QgkUm59K5MFphLN2CMdPqcUy6rEp-8mNC-YYCw@mail.gmail.com> (raw)
In-Reply-To: <CAHw75vveo7z8skQ+DRnhq7-EZsLwcn7KQZPvLPOV=naxWC6Mwg@mail.gmail.com>
References: <CAL64pZOtFxSe7qZ745KhPg1gdm8nSafRUWEPSZdN1TFS0AProg@mail.gmail.com>
	<CAHw75vvq1-YMHgk5k6BTD51tPb1BZYKEkY_0chX0144micm_dQ@mail.gmail.com>
	<CAL64pZP+5M6=pLAD_-ajQSOsb8E7fgnk6NdCtSDHQbuScAt3nQ@mail.gmail.com>
	<CAHw75vtX4UCfPrhFSYfDPEXfFO5CkZ5uoRz4qkWoVgMzhy3abQ@mail.gmail.com>
	<CAL64pZPtHTi4hTeQFiaC5rfZaNJCxmM8Bq7m4Mw7dPZNaRbp=Q@mail.gmail.com>
	<CAHw75vveo7z8skQ+DRnhq7-EZsLwcn7KQZPvLPOV=naxWC6Mwg@mail.gmail.com>

On Tue, Sep 15, 2020 at 12:21 PM Keith <[email protected]> wrote:

>
>
> On Tue, Sep 15, 2020 at 12:14 PM Killian Driscoll <
> [email protected]> wrote:
>
>> Thanks.
>>
>> If I enter:
>> Server [localhost]:  pg_restore --dbname=project_28_3_17 -h localhost -p
>> 543 2 -U postgres --create --verbose C:\ project_28_3_17.out
>>
>> It then says "Database [postgres]:" in the command line, but nothing
>> appears to have happened.
>>
>> Regards,
>> Killian DriscoIl
>>
>
>
> Not sure if it's a copy-n-paste issue, but you have a space in the port
> number (543 2   vs   5432)
>
> It would've thought it would've given an error for that tho. I'm not sure
> what that prompt means. I don't run PostgreSQL on windows myself.
>
>

Just realized, are you running pg_restore while logged into psql? The
pg_restore command is an independent command that gets run outside of psql.

https://www.postgresql.org/docs/current/app-pgrestore.html


Also, please keep the mailing list in the CC so that others that come
across this in the future know the answers that have been given.



>
>>
>> On Tue, 15 Sep 2020 at 17:58, Keith <[email protected]> wrote:
>>
>>>
>>>
>>> On Tue, Sep 15, 2020 at 11:40 AM Killian Driscoll <
>>> [email protected]> wrote:
>>>
>>>> Thanks.
>>>> I am using Windows 7. I have installed 9.3, and have the SQL Shell
>>>> (psql) open, and it says "Server [localhost]:" Do I enter the commands
>>>> there? I have the .out file in my C drive, but do I need to move it to a
>>>> particular PostgreSQL folder for it to restore?(Please bear with me, it's
>>>> years since I did this...).
>>>>
>>>> Regards,
>>>> Killian DriscoIl
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, 15 Sep 2020 at 17:32, Keith <[email protected]> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Tue, Sep 15, 2020 at 11:00 AM Killian Driscoll <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> I have a backup of a small database last used in 2016, with the
>>>>>> backup saved as an .out file and .sql file in version 9.3. I no longer have
>>>>>> PostgreSQL installed. I want to access the database again, and see that
>>>>>> version 9.3 is not supported. Can I download version 12 and restore the
>>>>>> file, or should I install version 9.3?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Killian DriscoIl
>>>>>>
>>>>>>
>>>>> pg_restore does its best to be backwards compatible to try and load
>>>>> old dump files. So I would just try it and see with PG12.
>>>>>
>>>>> However, there is a chance, depending on what was in that old version,
>>>>> that it may not restore without error. In that case, you could bring up a
>>>>> 9.3 cluster and restore the dump there. Then use the pg_dump binary from
>>>>> PG12 to create a new dump. The newer pg_dump binaries running on old
>>>>> servers try and convert things as needed.
>>>>>
>>>>>
>>> Dump backups of PostgreSQL are either one giant, plaintext sql file that
>>> contains all roles and databases in the old cluster (generated by
>>> pg_dumpall). Or there are two or more files, one plaintext that contains
>>> just global info (roles & tablespaces) and one or more database dumps
>>> (typically binary dumps done with pg_dump -Fc).
>>>
>>> Plain sql files must be restored with psql (or some other program that
>>> can read plaintext sql). You can feed an sql file to the psql command with
>>> the -f option. It doesn't need to be in any particular place as long as you
>>> give the proper path to -f
>>>
>>> Binary dump files (assuming that's what the .out file was) must be
>>> restored with pg_restore. Binary pg_dump files only contain a single
>>> database and do not contain role information. So if the roles it's
>>> expecting to run GRANT commands on don't exist, you may get errors. So
>>> typically there's a plaintext sql file with the roles you should be
>>> restoring first if you are doing a full restore to a clean instance.
>>>
>>>
>>>


view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Open version 9.3 .out file with version 12
  In-Reply-To: <CAHw75vsX-ww6QgkUm59K5MFphLN2CMdPqcUy6rEp-8mNC-YYCw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox