← Back to team overview

dhis2-devs team mailing list archive

Re: [SUSPECTED SPAM] RE: Restoring backup

 

Thanks Bob. 

Am currently out of the office. I will do 
this as soon as am back there today.


------ Original message------
From: Bob Jolliffe
Date: Thu, 19 May 2016 15:42
To: Chisom;
Cc: ceneja@xxxxxxxxxxxxx;iokoye@xxxxxxxxx;johansa@xxxxxxxxxx;dhis2-devs@xxxxxxxxxxxxxxxxxxx;
Subject:Re: [SUSPECTED SPAM] RE: [Dhis2-devs] Restoring backup

OK you can see the contents of the file so we know it is a plain text dump.

Assuming the file is called dbdump.sql and your database is called
dhis, then try the following from the commandline and report back what
you get:

sudo -u postgres psql -d dhis -f dbdump.sql

(you might need to change the name of the database and the dump file
to suit what you have)

On 19 May 2016 at 14:36, Chisom  wrote:
> Dear Bob,
>
>
>
> Yes I can see the contents of the file. The machine runs trusty and DHIS2 is
> setup. And yes, am part of a team of three responsible for maintaining the
> server. Sadly, I have never had to do this kind of db restore before and
> neither has any member of the team.
>
>
>
> Any help would be great.
>
>
>
> ------ Original message------
>
> From: Bob Jolliffe
>
> Date: Thu, 19 May 2016 14:52
>
> To: Chisom;
>
> Cc:
> ceneja@xxxxxxxxxxxxx;iokoye@xxxxxxxxx;johansa@xxxxxxxxxx;dhis2-devs@xxxxxxxxxxxxxxxxxxx;
>
> Subject:Re: [SUSPECTED SPAM] RE: [Dhis2-devs] Restoring backup
>
>
>
> Hi Eneja
>
> It is indeed possible to connect to postgres on the ubuntu server from
> pgadmin on windows, but it requires changing a configuration setting
> on postgres.  By default it won't listen to network connections for
> security reasons.
>
> In general I would leave that setting alone unless you know exactly
> what you are doing.
>
> You still haven't responded to my earlier question - ie what is in
> that file?  Is it text?  Can you look?  If not with 'less' then maybe
> even with notepad or something.  If we can resolve this first question
> (that the file is ok) then we can move to the next, which is how to
> restore it.
>
> But I think you may need to step back a little.  In particular what is
> this ubuntu server and who is responsible for maintaining it.  If you
> are struggling to restore a file then I would worry that you are not
> really very much in control of this machine which doesn't bode well.
> Possibly you need to get some outside support from someone nearby who
> has some ubuntu familiarity.
>
> Bob
>
> On 19 May 2016 at 12:52, Chisom  wrote:
>> Thanks Bob.
>>
>>
>>
>> I've done that at the postgres# prompt and there's simply no feedback. I
>> am
>> contemplating installing pgAdmin on the server then attempt to connect to
>> it
>> from a Windows pc. Do you think this is a good way to proceed?
>>
>>
>>
>> Regards,
>>
>> Eneja.
>>
>>
>>
>> ------ Original message------
>>
>> From: Bob Jolliffe
>>
>> Date: Thu, 19 May 2016 14:37
>>
>> To: CHIKWADO ENEJA;
>>
>> Cc: iokoye@xxxxxxxxx;johansa@xxxxxxxxxx;dhis2-devs@xxxxxxxxxxxxxxxxxxx;
>>
>> Subject:Re: [SUSPECTED SPAM] RE: [Dhis2-devs] Restoring backup
>>
>> Hi Eneja
>>
>> Please see my earlier request for more exact information.  It sounds
>> to me that your pgAdmin dump is not in plain text format.  In which
>> case you would have to use pg_restore rather than psql to restore it.
>> But you can easily verify by just looking inside the file to see if it
>> is a text file - eg using less as I indicated.
>>
>> Regards
>> Bob
>>
>> On 19 May 2016 at 13:23, CHIKWADO ENEJA  wrote:
>>> Dear Bob,
>>>
>>>
>>>
>>> The backup made has been copied into a folder in the server. The
>>> challenge
>>> I
>>> have had is to restore that file into an existing database.
>>>
>>>
>>>
>>> Regards.
>>>
>>>
>>>
>>> C Eneja
>>>
>>>
>>>
>>> ------ Original message------
>>>
>>> From: Dr. Ifeanyi Okoye
>>>
>>> Date: Thu, 19 May 2016 13:55
>>>
>>> To: 'Bob Jolliffe';'Johan Ivar Sæbø';
>>>
>>> Cc: 'dhis2-devs';CHIKWADO ENEJA;
>>>
>>> Subject:[SUSPECTED SPAM] RE: [Dhis2-devs] Restoring backup
>>>
>>>
>>>
>>> Hello Bob,
>>> I created the backup file using pgAdmin for Windows. I use PG9.4 with
>>> DHIS
>>> Live on my laptop.
>>> I created it as a plain backup. Size is 3MB.
>>>
>>> We are now trying to restore the file to an Ubuntu server also running
>>> PG9.4
>>> and having some difficulty reading in the file.
>>>
>>> Lt. Eneja, please could you give Bob some more details as requested?
>>>
>>> Thank you.
>>>
>>> Ifeanyi Okoye MB;BS, M.Inf.Sc | Strategic Information Manager
>>> Strategic Information Unit, US Department of Defense-Walter Reed Program
>>> Nigeria
>>> Embassy of the United States of America, Plot 1075 Diplomatic Drive, CBD,
>>> Abuja, Nigeria
>>> Work: +234-9-461-4000 Ext 4560 | Mobile: +234-805-519-2251 | Email:
>>> iokoye@xxxxxxxxx
>>> www.hivresearch.org, www.wrp-n.org
>>>
>>>
>>> -----Original Message-----
>>> From: Bob Jolliffe [mailto:bobjolliffe@xxxxxxxxx]
>>> Sent: 19 May 2016 11:09
>>> To: Johan Ivar Sæbø
>>> Cc: Dr. Ifeanyi Okoye ; dhis2-devs
>>> ; CHIKWADO ENEJA
>>> Subject: Re: [Dhis2-devs] Restoring backup
>>>
>>> Hi Ifeany
>>>
>>> Can you give exact psql command you are using and the output?
>>>
>>> If it is a plain text format you should be able to see the sql commands
>>> in
>>> it by running a command like 'less backup.sql' (assuming that is the name
>>> of
>>> your file).  That is always good to verify that what you have is indeed a
>>> plain (and uncorrupted) file.
>>>
>>> Bob
>>>
>>>
>>>
>>> On 19 May 2016 at 09:52, Johan Ivar Sæbø  wrote:
>>>> Hi Ifeany,
>>>>
>>>> I forward this to the developer list, which is a good place to direct
>>>> such issues. You should create an account and join the list here:
>>>> https://launchpad.net/~dhis2-devs
>>>>
>>>> I leave it to someone with more expertise to help with the backup
>>>> restoration.
>>>> Johan
>>>>
>>>> On 18.05.2016 19:57, Dr. Ifeanyi Okoye wrote:
>>>>>
>>>>> Hello Johan,
>>>>> I hope you are doing well.
>>>>>
>>>>> I need some technical help with DHIS2 and looking for someone to talk
>>>>> to.
>>>>>
>>>>> I created a db backup file in plain format using pgAdmin for Windows
>>>>> (PostgreSQL 9.4). I am trying to restore the backup file to a Postgre
>>>>> db in Ubuntu with psql but it is just not working. Says it cannot read
>>>>> file.
>>>>>
>>>>> Who can I talk to to help with this. Been driving us nuts all day.
>>>>>
>>>>> My colleague can give some more insight into this.
>>>>>
>>>>> Looking forward to hearing from you.
>>>>>
>>>>> Ifeanyi Okoye MB;BS, M.Inf.Sc | Strategic Information Manager
>>>>> Strategic Information Unit, US Department of Defense-Walter Reed
>>>>> Program Nigeria Embassy of the United States of America, Plot 1075
>>>>> Diplomatic Drive, CBD, Abuja, Nigeria
>>>>> Work: +234-9-461-4000 Ext 4560 | Mobile: +234-805-519-2251 | Email:
>>>>> iokoye@xxxxxxxxx
>>>>> www.hivresearch.org, www.wrp-n.org
>>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>> More help   : https://help.launchpad.net/ListHelp
>>>
>