Thread: Re: Need Database Backup

Re: Need Database Backup

From
Scott Marlowe
Date:
OK we're gonna need to keep this on the list, as other folks may be a much better choice to help you than me (I'm not a Windows guy.)

OK so we need more info to help. I don't know how to fix the NTLDR problem, etc, because it's windows. However, the folks who might be able to help need more info.

Specifically, what are you doing to try and load the .sql extension?
Are you using a second machine for this?
Have you made a backup of the files in d:\Program Files\Postgresql and put it in a safe place? It's important to NOT mess around with the only copy in case things go wrong with it.
What exactly HAVE you done to try and move the PostgreSQL directory elsewhere? What EXACT errors are you seeing.

The more information you provide the more we can help. Right now you're asking for help, but you're not helping yourself, because you're not showing us what's going wrong. More details gets you more answers.

On Sun, Aug 30, 2015 at 3:39 AM, Murali N Rao <muralihw03@rediffmail.com> wrote:
Sir,

Suddenly Our system got restarted and we got a msg NTLDR Missing. I tried to repair but not able.

OS: windows 2003 Server

We installed the PGSQL in D:\program files\Postgresql

I have whole folder having capacity of 1.53 GB

and i have recently taken backup on 01st of August with Extension (.sql) even i cant upload that.

Please i request u to do the need ful

Regards

Murali N
System Admin,
CIT, Gubbi


From: Scott Marlowe <scott.marlowe@gmail.com>
Sent: Sun, 30 Aug 2015 09:34:42
To: muralihw03@rediffmail.com
Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Need Database Backup
On Fri, Aug 28, 2015 at 11:27 PM, Murali N Rao
<muralihw03@rediffmail.com> wrote:

> Sir,
>
> We were using newgenlib software which is having postgresql as backend.
>
> Suddenly Our Systems OS got corrupted and unable to start and we have taken installed folder as backup from the drive but we are unable to restore and kindly help in this.
>
> and also we have also taken backup 30 days in .sql format but even i am unable to upload.
>
> So, i kindly request u to help in this as the database contains more than 2000 Students data
>

OK let's see what we can do to help you. What OS are you running? How
idd you move the database directory to the new machine? What errors
are you getting when you to start the db? What errors are you getting
when trying to restore from your old .sql backup? What version of
pgsql are you running?

Just kinda imagine one of us is looking over your shoulder and tell us
everything. Details that may seem small and unimportant can be very
important in helping to troubleshoot this kind of thing.

Get your own FREE website, FREE domain & FREE mobile app with Company email.  
Know More >



--
To understand recursion, one must first understand recursion.

Re: Need Database Backup

From
"Charles Clavadetscher"
Date:
Hi

I agree with all upthreads mentioning that the amount of information you (Murali) deliver is much too little to help.
Neverthelessmy thoughts. 

- NTLDR Missing is obviously a Windows problem and I don't think that it has to do with PostgreSQL. You may find better
helpon a Windows forum or mailing list. 
- If you have produced a SQL file dumping your whole clusterv (pg_dumpall), then you should only need to reinstall
PostgreSQLand run the file as a script (from command line or psql). There is no upload of sql file, unless I don't
understandwhat you mean. 

Bye
Charles

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Scott Marlowe
Sent: Sonntag, 30. August 2015 15:36
To: muralihw03@rediffmail.com; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Need Database Backup

OK we're gonna need to keep this on the list, as other folks may be a much better choice to help you than me (I'm not a
Windowsguy.) 
OK so we need more info to help. I don't know how to fix the NTLDR problem, etc, because it's windows. However, the
folkswho might be able to help need more info. 
Specifically, what are you doing to try and load the .sql extension?
Are you using a second machine for this?
Have you made a backup of the files in d:\Program Files\Postgresql and put it in a safe place? It's important to NOT
messaround with the only copy in case things go wrong with it.  
What exactly HAVE you done to try and move the PostgreSQL directory elsewhere? What EXACT errors are you seeing.
The more information you provide the more we can help. Right now you're asking for help, but you're not helping
yourself,because you're not showing us what's going wrong. More details gets you more answers. 

On Sun, Aug 30, 2015 at 3:39 AM, Murali N Rao <muralihw03@rediffmail.com> wrote:
Sir,

Suddenly Our system got restarted and we got a msg NTLDR Missing. I tried to repair but not able.

OS: windows 2003 Server

We installed the PGSQL in D:\program files\Postgresql

I have whole folder having capacity of 1.53 GB

and i have recently taken backup on 01st of August with Extension (.sql) even i cant upload that.

Please i request u to do the need ful

Regards

Murali N
System Admin,
CIT, Gubbi


From: Scott Marlowe <scott.marlowe@gmail.com>
Sent: Sun, 30 Aug 2015 09:34:42
To: muralihw03@rediffmail.com
Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Need Database Backup
On Fri, Aug 28, 2015 at 11:27 PM, Murali N Rao
<muralihw03@rediffmail.com> wrote:

> Sir,
>
> We were using newgenlib software which is having postgresql as backend.
>
> Suddenly Our Systems OS got corrupted and unable to start and we have taken installed folder as backup from the drive
butwe are unable to restore and kindly help in this. 
>
> and also we have also taken backup 30 days in .sql format but even i am unable to upload.
>
> So, i kindly request u to help in this as the database contains more than 2000 Students data
>

OK let's see what we can do to help you. What OS are you running? How
idd you move the database directory to the new machine? What errors
are you getting when you to start the db? What errors are you getting
when trying to restore from your old .sql backup? What version of
pgsql are you running?

Just kinda imagine one of us is looking over your shoulder and tell us
everything. Details that may seem small and unimportant can be very
important in helping to troubleshoot this kind of thing.

Get your own FREE website, FREE domain & FREE mobile app with Company email.
Know More >



--
To understand recursion, one must first understand recursion.



Re: Need Database Backup

From
Adrian Klaver
Date:
On 08/30/2015 06:36 AM, Scott Marlowe wrote:
> OK we're gonna need to keep this on the list, as other folks may be a
> much better choice to help you than me (I'm not a Windows guy.)
>
> OK so we need more info to help. I don't know how to fix the NTLDR
> problem, etc, because it's windows. However, the folks who might be able
> to help need more info.

What I could find:

https://support.microsoft.com/en-us/kb/816793

>
> Specifically, what are you doing to try and load the .sql extension?

My guess is the OP is using pgAdmin and is trying to restore via the
restore wizard. That only handles custom format backups and not
text(plain) formats.

> Are you using a second machine for this?
> Have you made a backup of the files in d:\Program Files\Postgresql and
> put it in a safe place? It's important to NOT mess around with the only
> copy in case things go wrong with it.

Also, how was Postgres initially installed?

> What exactly HAVE you done to try and move the PostgreSQL directory
> elsewhere? What EXACT errors are you seeing.
>
> The more information you provide the more we can help. Right now you're
> asking for help, but you're not helping yourself, because you're not
> showing us what's going wrong. More details gets you more answers.
>



--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Need Database Backup

From
Melvin Davidson
Date:
You need to recreate the database to reload the data into so
     
   from the windows command line:
   C:\PostgresDB\bin\createdb.exe -U postgres <your db name>;
  
   Then to restore the data from the sql backup
   C:\PostgresDB\bin\pg_restore.exe -U postgres <the sql backup file>


On Sun, Aug 30, 2015 at 10:06 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 08/30/2015 06:36 AM, Scott Marlowe wrote:
OK we're gonna need to keep this on the list, as other folks may be a
much better choice to help you than me (I'm not a Windows guy.)

OK so we need more info to help. I don't know how to fix the NTLDR
problem, etc, because it's windows. However, the folks who might be able
to help need more info.

What I could find:

https://support.microsoft.com/en-us/kb/816793


Specifically, what are you doing to try and load the .sql extension?

My guess is the OP is using pgAdmin and is trying to restore via the restore wizard. That only handles custom format backups and not text(plain) formats.

Are you using a second machine for this?
Have you made a backup of the files in d:\Program Files\Postgresql and
put it in a safe place? It's important to NOT mess around with the only
copy in case things go wrong with it.

Also, how was Postgres initially installed?

What exactly HAVE you done to try and move the PostgreSQL directory
elsewhere? What EXACT errors are you seeing.

The more information you provide the more we can help. Right now you're
asking for help, but you're not helping yourself, because you're not
showing us what's going wrong. More details gets you more answers.




--
Adrian Klaver
adrian.klaver@aklaver.com



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

Re: Need Database Backup

From
Adrian Klaver
Date:
On 08/30/2015 07:13 AM, Melvin Davidson wrote:
> You need to recreate the database to reload the data into so
>
>     from the windows command line:
>     C:\PostgresDB\bin\createdb.exe -U postgres <your db name>;

That assumes Postgres is running, which at this point seems not to be
the case or at least is unproven.

>
>     Then to restore the data from the sql backup
>     C:\PostgresDB\bin\pg_restore.exe -U postgres <the sql backup file>

This will not work if the *.sql is a plain text file.

>
>



--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Need Database Backup

From
Melvin Davidson
Date:
Adrian
From Murali N Rao 5:43 AM (4 hours ago)

>now i have installed new os and installed PGSQL again it working now but no data


On Sun, Aug 30, 2015 at 10:21 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 08/30/2015 07:13 AM, Melvin Davidson wrote:
You need to recreate the database to reload the data into so

    from the windows command line:
    C:\PostgresDB\bin\createdb.exe -U postgres <your db name>;

That assumes Postgres is running, which at this point seems not to be the case or at least is unproven.


    Then to restore the data from the sql backup
    C:\PostgresDB\bin\pg_restore.exe -U postgres <the sql backup file>

This will not work if the *.sql is a plain text file.






--
Adrian Klaver
adrian.klaver@aklaver.com



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

Re: Need Database Backup

From
"Charles Clavadetscher"
Date:
Well the rest should be easy.

psql -U ... -h ... -p ... -d ... -f sql_file.sql

http://www.postgresql.org/docs/9.4/static/app-psql.html option "f"

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Melvin Davidson
Sent: Sonntag, 30. August 2015 16:27
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>; muralihw03@rediffmail.com; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Need Database Backup

Adrian
From Murali N Rao 5:43 AM (4 hours ago)

>now i have installed new os and installed PGSQL again it working now but no data

On Sun, Aug 30, 2015 at 10:21 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 08/30/2015 07:13 AM, Melvin Davidson wrote:
You need to recreate the database to reload the data into so

    from the windows command line:
    C:\PostgresDB\bin\createdb.exe -U postgres <your db name>;

That assumes Postgres is running, which at this point seems not to be the case or at least is unproven.

    Then to restore the data from the sql backup
    C:\PostgresDB\bin\pg_restore.exe -U postgres <the sql backup file>

This will not work if the *.sql is a plain text file.




--
Adrian Klaver
adrian.klaver@aklaver.com



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.



Re: Need Database Backup

From
Adrian Klaver
Date:
On 08/30/2015 07:27 AM, Melvin Davidson wrote:
> Adrian
>  From Murali N Rao 5:43 AM (4 hours ago)
>
>  >now i have installed new os and installed PGSQL again it working now
> but no data

Aaah, missed that, so Postgres is running, thanks.



--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Need Database Backup

From
Adrian Klaver
Date:
On 08/30/2015 07:27 AM, Melvin Davidson wrote:
> Adrian
>  From Murali N Rao 5:43 AM (4 hours ago)
>
>  >now i have installed new os and installed PGSQL again it working now
> but no data

I plead lack of coffee, but where is that message and was there more in it?

>
>
> On Sun, Aug 30, 2015 at 10:21 AM, Adrian Klaver
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>
>     On 08/30/2015 07:13 AM, Melvin Davidson wrote:
>
>         You need to recreate the database to reload the data into so
>
>              from the windows command line:
>              C:\PostgresDB\bin\createdb.exe -U postgres <your db name>;
>
>
>     That assumes Postgres is running, which at this point seems not to
>     be the case or at least is unproven.
>
>
>              Then to restore the data from the sql backup
>              C:\PostgresDB\bin\pg_restore.exe -U postgres <the sql
>         backup file>
>
>
>     This will not work if the *.sql is a plain text file.
>
>
>
>
>
>
>     --
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
>
>
>
> --
> *Melvin Davidson*
> I reserve the right to fantasize.  Whether or not you
> wish to share my fantasy is entirely up to you.


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Need Database Backup

From
Melvin Davidson
Date:
Good catch Adrian,

Murali,
Please change the restore command to

C:\PostgresDB\bin\psql.exe -U postgres -d <the database name> -f <your backup file name>


On Sun, Aug 30, 2015 at 10:40 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 08/30/2015 07:27 AM, Melvin Davidson wrote:
Adrian
 From Murali N Rao 5:43 AM (4 hours ago)

 >now i have installed new os and installed PGSQL again it working now
but no data

I plead lack of coffee, but where is that message and was there more in it?



On Sun, Aug 30, 2015 at 10:21 AM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

    On 08/30/2015 07:13 AM, Melvin Davidson wrote:

        You need to recreate the database to reload the data into so

             from the windows command line:
             C:\PostgresDB\bin\createdb.exe -U postgres <your db name>;


    That assumes Postgres is running, which at this point seems not to
    be the case or at least is unproven.


             Then to restore the data from the sql backup
             C:\PostgresDB\bin\pg_restore.exe -U postgres <the sql
        backup file>


    This will not work if the *.sql is a plain text file.






    --
    Adrian Klaver
    adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>




--
*Melvin Davidson*
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.


--
Adrian Klaver
adrian.klaver@aklaver.com



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.