← Back to team overview

dhis2-users team mailing list archive

Re: Cross database querying for updating data

 

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