← Back to team overview

dhis2-devs-core team mailing list archive

Re: faster pg_dump and pg_restore

 

Thanks for sharing this Lars. I tried it now and restore works much faster
than before.
Can you please share the demo database in directory format here -
https://www.dhis2.org/downloads

---
Regards,
Saptarshi PURKAYASTHA
Visiting assistant professor
Department of BioHealth Informatics, IUPUI

On 23 October 2015 at 07:51, Lars Helge Øverland <larshelge@xxxxxxxxx>
wrote:

> Hi,
>
> just wanted to share a tip on how to dump and restore postgres databases
> using the "directory" format which allows for parallel jobs - much faster
> on multi-core machines:
>
> *dhis2db = db name*
> *dhis = db user*
> *dbdump = demo database output name*
> *-j 4 = 4 parallel jobs*
> *-Fd = directory format*
>
> *Dump:*
>
> pg_dump *dhis2db* -Fd -U dhis -T analytics* -j 4 -f *dbdump*
>
> *Restore:*
>
> pg_restore -d *dhis2db* -U dhis -j 4 *dbdump*
>
>
> --
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org <https://www.dhis2.org>
>
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to     : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp
>
>

References