POSTGRESQL BACKUP AND RESTORE

#let's create a backup from remote postgresql database using pg_dump: # # pg_dump -h [host address] -Fc -o -U [database user] <database name> > [dump file] # #later it could be restored at the same remote server using: # # sudo -u postgres pg_restore -C mydb_backup.dump # #Ex: pg_dump -h 67.8.78.10 -Fc -o -U myuser mydb > mydb_backup.dump #complete (all databases and objects) pg_dumpall -U myuser -h 67.8.78.10 --clean --file=mydb_backup.dump #restore from pg_dumpall --clean: psql -f mydb_backup.dump postgres #it doesn't matter which db you select here /var/www/html# pg_dump -h his.autana.tech -p 5433 -Fc -o -U autana autana > autana010219.dump
POSTGRESQL BACKUP AND RESTORE

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.