ELMA365 On-Premises > Configuration / External databases backup

External databases backup

PostgreSQL Dump

To dump the PostgreSQL database, use the standard utility function:

pg_dump $postgresURL -C -c --if-exists -F directory -f $postgresDIR

MongoDB Dump

To dump the MongoDB database, use the standard utility function:

mongodump --uri $mongoURL --gzip --quiet --out $mongoDIR

S3 Dump

To copy the files, you can use any utility that connects to the S3 database, for example the mc:

mc mirror $source $destination

Restore PostgreSQL

To restore the PostgreSQL database, enter the following command:

pg_restore -d $postgresURL -j 1 -F directory $postgresDIR

Restore MongoDB

To restore the MongoDB database, enter the following command:

mongorestore --uri $mongoURL --dir $mongoDIR --drop --gzip --preserveUUID --excludeCollection=head.settings.view

Copy S3 files

To copy the files, use the command:

mc cp $backup $destination

 

 

Found a typo? Highlight the text, press ctrl + enter and notify us