Odoo Help


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.


[v8] how fix this "syntax error at or near [dump_name]" error when restoring a database

on 12/27/14, 8:42 PM 1,115 views

I want to restore a dumped database. my starting point is a dump_name.sql.tar.gz file

:~$ sudo su - odoo

:~$ createdb [new_db_name]

:~$ tar -xvzf /[path/to/backup/dump_name.sql.tar.gz] | psql [new_db_name]

ERROR     syntax error at or near [dump_name]

LINE 1 dump_name.sql     # (has an up-arrow under the 'd' of dump_name)


any idea what the problem might be? It's not access rights. The [dump_name] that has been extracted is odoo:odoo & 775

I though I could try separate extractin the .tar file and attach the .sql file to my [new_database]. What would the command be for that


Hardikgiri Goswami

--Hardikgiri Goswami--
| 2 1 5
Rajkot, India
--Hardikgiri Goswami--

OpenERP/Odoo Customization/Integration Expert / Python Programmer

Skype ID : hardikgiri.goswami

Hardikgiri Goswami
On 12/28/14, 2:00 AM

Dear Gunnar,

I have seen the commands you fired on the terminal and I have tried it too, It says "Syntax Error".
You are tring to execute two commands in a single line.
Lets make it easy.

CMD 1 : tar -xvzf [path/to/backup/dump_name.sql.tar.gz]
CMD 2 : psql [new_db_name] < [dump_name.sql]

Just try this and let me know it any error occurs.
Just Ignore the Error "role "openerp" does not exist".

Best Wishes,

separating tar & psql commands did work, thanks

on 12/28/14, 3:37 AM

Hello Gunnar, Please up vote for the answer.

Hardikgiri Goswami
on 12/29/14, 2:12 AM

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)


Asked: 12/27/14, 8:42 PM
Seen: 1115 times
Last updated: 3/16/15, 8:10 AM