Skip to Content
Menu
This question has been flagged
10 Replies
76064 Views

Hi I am having a backup of database of odoo as dump.sql.

When I am trying to restore it back to a  new database in postgresql, I am unable to restore it shows "psql:D:/dump/dump.sql:117019: ERROR: invalid input syntax for integer: " /. "CONTEXT: COPY account_account, line 79, column id: " /. "

I am using command as \i file_path/dump.sql

 when I am trying to execute a

Copy tale_name (fields....) from stdin;

1 . . . .data

it shows error 

How can I execute this and how can I restore dump.sql without error ?



Avatar
Discard

what is the OS you'r using and the OS the database was backup from?

Author

I am using Windows OS, and the OS database was backup from was ubuntu

Is there any security issues with difference in OS @Mahmou Sekawe

Best Answer

you can try this process:

First copy your dump.sql into desired server or desktop if you re in localhost

Next create manually a database with createdb dbname;

And after that import your dump.sql definition in your database created via psql dbname <  yourpath/dump.sql

next affect your database to owner odoo

ALTERDATABASE OdooDb OWNER TO odoo

Afterwards give the role odoo in database the SUPER USER rights with

 ALTER USER user_name with SUPER USER;

Finally 

copy the files under filestore generated with database in your filestore database for example under Centos 7 you 'll find it in /var/lib/fielstore/dbname

And after that you can open your db on odoo

Note your addons modules must be synchronized with your actual database 

  



Avatar
Discard

Thanks a lot man :D

Best Answer

Hi,

In odoo 10 while clicking on Backup and then entering master password getting following error,


Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpxi53It/dump.sql', u'database_db01') error 1

what could be the reason as my hosting is on AWS. thanks

Avatar
Discard
Best Answer

If your had dowloaded the database from Odoo online can execute this command from the terminal line, just change the bold parameters with your owns:

curl -F 'master_pwd=your_db_pwd' -F backup_file=@/path_to_the_directory/file_to_import.zip -F 'copy=true' -F 'name=db_name' http://your_IP_Address:8069/web/database/restore

Avatar
Discard
Best Answer

You can restore the database using terminal by following below listed commands.

createdb dbname

go to source file where you locate dump file

pg_restore -c -d db_name filename.dump(for dump file)

Avatar
Discard
Best Answer

you can try through front end 

http://localhost/web/database/manager#action=database_manager or Manage database option and select restore then give master pwd and database name and user name and pwd. The database will restore

Avatar
Discard
Author Best Answer

It is not allowing to restore from the front end. I tried it but it didn't worked.

so trying it from postgresql DB level, when I am trying to execute the dump file query it is showing errors as mentioned above.

I am trying it from psql console using command \i file_name.sql.  It gives syntax error as 

"psql:C:/Users/sevate/Desktop/trainingdb_2017-01-07_09-39-27/dump2.sql:117019: ERROR: invalid input syntax for integer: "/. " CONTEXT: COPY account_account, line 79, column id: " /. "

Avatar
Discard
Related Posts Replies Views Activity
3
Jun 16
6062
1
May 16
7093
1
Nov 24
102
2
Oct 24
237
1
Apr 24
336