Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How can i take back of Database by Terminal.

By
Logicious
on 5/3/16, 1:28 AM 544 views

Hello,

Anyone knows how to take back of database by terminal. I need to take database backup of my server, by terminal.Is there is any  commands that is used for take backup from server. I searched lot, and i tried those what i got , but its not succeed.Could you please help me to do this?


thanking you,

Logicious

1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 5/3/16, 1:50 AM

Hello,

You can also have an eye on this question it may helps



@ahmed : i already seen this sh script , i don't want use script because i doesn't have experience with scripting .

Logicious
on 5/3/16, 1:59 AM

You don't need to use the all script. E.g you can use: pg_dump -E UTF-8 -p 5433 -F p -b -f $filename $db to execute the dumping ... $filename is where you will put the dump and $db is your database name ...

Ahmed M.Elmubarak
on 5/3/16, 2:14 AM

@ahmed :- Thank you i will try...

Logicious
on 5/3/16, 2:46 AM
0
Olalekan Babawale
On 5/6/16, 5:41 AM

Hi,

A. To backup your database

    1. switch to postgres user

    sudo su - postgres

    2. backup with the ff command;

    pg_dump db_name > db_backup.sql

     [note db_name is the name of the database you want to backup; db_backup.sqlis the name you want to give your backup. Whatever name you want to give to your backup, end it with the .sql extension]

    3. To get the location of your backup, run this command from the terminal

    find / -name db_backup.sql


B.

    1. If your database is on a remote computer, connect to it using WinSCP;  supply your username and password

    2. browse to the directory where your backup is saved as gotten in step 3 of A above

     3. you can then copy the sql file to your desired location or download to a location on your local computer in case it is on         a remote computer.

I hope this helps a lot.


0
Krupesh Laiya
On 5/6/16, 4:58 AM

Hi

pg_dump dbname | gzip > filename.gz

Reload with

createdb dbname

gunzip -c filename.gz | psql dbname

or you can refer link: http://www.postgresql.org/docs/8.1/static/backup.html

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/3/16, 1:28 AM
Seen: 544 times
Last updated: 7/7/16, 6:22 AM