1.) Install postgresql (execute inwards terminal):
sudo apt-get install postgresql postgresql-contrib
2.) Setup postgres user:
sudo -u postgres psql modify user postgres password 'postgres' //close the final after.
3.) To cheque install pgadmin via "Ubuntu Update Center", in addition to show to login using postgres/postgres account.
4.) Perform dump/restore. But earlier performing the ff commands, you lot should login every bit postgres first:
sudo su postgres
+Create the dumps:
//dump the roles pg_dumpall -g -U postgres > roles.sql +Dump the schema pg_dump -Fp -s -v -f schema.sql -U postgres databaseName +Dump the information pg_dump -Fc -v -f data.dump -U postgres databaseName
+How to restore
psql -f roles.sql psql -f schema.sql databaseName pg_restore -a -d databaseName -Fc data.dump
Note: Got this somewhere else, simply added around to a greater extent than statements.
0 komentar:
Please comment if there are any that need to be asked.