Without having to use tools like pgAdmin, you can backup and restore database using console command
sometimes for large database the amount of time required to restore database is a bit long, you can speed it up by adding -j attributes followed by the number of concurrent process you want to run, lets say that I want to run 3 concurrent process for this restore, the command will be like this
Restore using pg_restore
this command will restore database from dmp file, please make sure you have create a database first, lets say that the database name is "dbname"pg_restore -d dbname backupfile.dmp -v
sometimes for large database the amount of time required to restore database is a bit long, you can speed it up by adding -j attributes followed by the number of concurrent process you want to run, lets say that I want to run 3 concurrent process for this restore, the command will be like this
pg_restore -d dbname backupfile.dmp -v -j 3
Restore using psql
this command will restore database from sql filepsql dbname < backupfile.sql
Restore using pg_restore from compressed file in gz format
to restore database from a compressed file you can either unzip it first and restore it with the above command, or you can simply use this commandsgunzip -c backupfile.gz | psql dbname
No comments :
Post a Comment