← Back to team overview

dhis2-users team mailing list archive

Re: Cross database querying for updating data

 

I had thought of  data import/export functionality, however this will
require two instances of tomcat to be running. (or one instance with one
database at a time, however there will be an associated down time).
Since upgrading to 2.18, when exported, the resultant download zip file
says invalid for all formats (xml, json, excel) and is only 2kb in size
regardless of the hierarchy I choose.

Since one database is copy of the other, i thought I could easily update
from the other as described.

On Mon, Apr 20, 2015 at 3:48 PM, Jason Pickering <
jason.p.pickering@xxxxxxxxx> wrote:

> It may work, but in general, it will not because the internal IDs of
> different DHIS2 databases are not the same. So, it might work, but it
> requires both databases to be in essentially the same state. Better to use
> the data import/export functionality if you can.
>
> Regards,
> Jason
>
>
> On Mon, Apr 20, 2015 at 3:28 PM Muyepa A. <muyepaa@xxxxxxxxx> wrote:
>
>> Can I safely update DHIS2 database A with data from DHIS database B both
>> on the same PostgreSQL server by cross query. B is backup of A
>>
>> From database B, I can retrieve and save the data that is required using:
>>
>> psql B -c "\copy (select * from datavalue where  periodid='xxxx') TO
>> STDOUT" > /tmp/data.tsv;
>>
>>
>> And to restore:
>> psql A -c "\copy datavaue (x, y, z, ...) FROM /tmp/data.tsv"
>>
>>
>> Is this recommended, and what else should be cross  transferred.
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>

Follow ups

References