dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #10159
Re: Exporting without unnecessary tables
This script is actually quite out of date, as it does not exclude the
analytics tables, but rather the deprecated data mart tables.
pg_dump -T aggregated* -T analytics* -T completeness* -T _* -O $dbname |
gzip > $backupfilename
is usually what I use, which will also exclude the resource tables, which
may or may not be desired.
Also, not explicitly including the owner can also be useful with the "-O"
parameter which is useful if you are restoring the database to a system
with perhaps different ownership from the original database.
Regards,
Jason
On Thu, May 5, 2016 at 10:35 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
> Thanks John!
>
> I just realized this is of course also in the backup script at the bottom
> of this page:
> https://www.dhis2.org/downloads
>
> On Thu, May 5, 2016 at 3:04 PM, John Lewis <johnlewis.hisp@xxxxxxxxx>
> wrote:
>
>> pg_dump -T analytics* -T completeness* <database name> > <filename.sql>
>>
>> On Thu, May 5, 2016 at 3:31 PM, Knut Staring <knutst@xxxxxxxxx> wrote:
>> > Hi team,
>> >
>> > I know this has come up before (and perhaps even documented), but could
>> not
>> > find right now the full command to create a backup without analytics and
>> > other unnecessary tables.
>> >
>> > Could google it easily, but if someone has an optimized pg_dump command
>> > ready at hand, it could be nice to (re)share on the list?
>> >
>> > Thanks!
>> >
>> > --
>> > Knut Staring
>> > Dept. of Informatics, University of Oslo
>> > Norway: +4791880522
>> > Skype: knutstar
>> > http://dhis2.org
>> >
>> > _______________________________________________
>> > 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
>> >
>>
>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> Norway: +4791880522
> Skype: knutstar
> http://dhis2.org
>
> _______________________________________________
> 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
>
>
--
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049
References