Exporting without unnecessary tables

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

pg_dump -T analytics* -T completeness* <database name> > <filename.sql>

···

On Thu, May 5, 2016 at 3:31 PM, Knut Staring <knutst@gmail.com> 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@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp

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@gmail.com wrote:

pg_dump -T analytics* -T completeness* > <filename.sql>

On Thu, May 5, 2016 at 3:31 PM, Knut Staring knutst@gmail.com 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@lists.launchpad.net

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

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@gmail.com 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


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Thu, May 5, 2016 at 3:04 PM, John Lewis johnlewis.hisp@gmail.com wrote:

pg_dump -T analytics* -T completeness* > <filename.sql>

On Thu, May 5, 2016 at 3:31 PM, Knut Staring knutst@gmail.com 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@lists.launchpad.net

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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049