25 April 2011

PostgreSQL Backup and Restore

To backup and restore PostgreSQL with ignoring of database version us pg_dump and pg_restore like in next commands:

For Backup :

C:\pgsql\bin\pg_dump.exe
--host localhost
--port 5432
--username "username"
--format custom
--blobs
--ignore-version
--verbose
--file "postgresql.backup" databasename

For Restore :

C:\pgsql\bin\pg_restore.exe
--host localhost
--port 5432
--username username
--dbname databasename
--clean
--ignore-version
--verbose "postgresql.backup"

No comments: