This question has been flagged
2 Replies
11688 Views

I have odoo 11 install on my windows 10 laptop. I need to shift my db to raspberry pi 3 with last raspbian on-board.

When I trying to restore DB on raspberry I got error. Why I cant restore DB?

There is logs:

2018-01-04 13:16:28,500 9473 INFO obg_prod odoo.service.db: RESTORE DB: obg_prod 2018-01-04 13:16:28,539 9473 INFO obg_prod werkzeug: 192.168.1.237 - - [04/Jan/2018 13:16:28] "POST /web/database/restore HTTP/1.1" 303 - 2018-01-04 13:16:28,604 9473 INFO obg_prod odoo.addons.base.ir.ir_http: Generating routing map 2018-01-04 13:16:29,207 9473 INFO obg_prod odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 1 connections to 'dbname=obg_prod user=odoo sslmode=prefer'

2018-01-04 13:16:29,227 9473 INFO obg_prod werkzeug: 192.168.1.237 - - [04/Jan/2018 13:16:29] "GET /web/database/manager HTTP/1.1" 200 - 2018-01-04 13:16:30,677 9473 INFO obg_prod odoo.addons.fetchmail.models.fetchmail: start checking for new emails on imap server incoming - catchall@my-domname.com 2018-01-04 13:16:31,773 9473 INFO obg_prod odoo.addons.fetchmail.models.fetchmail: Fetched 0 email(s) on imap server incoming - catchall@my-domname.com; 0 succeeded, 0 failed.

2018-01-04 13:16:33,860 9473 ERROR obg_prod odoo.sql_db: bad query: b'INSERT INTO "ir_attachment" ("id", "res_model", "public", "res_id", "name", "datas_fname", "type", "mimetype", "company_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval(\'ir_attachment_id_seq\'), \'ir.ui.view\', true, 0, \'/web/content/css\', \'web.assets_common.0.css\', \'binary\', \'text/css\', 1, 1, 1, (now() at time zone \'UTC\'), (now() at time zone \'UTC\')) RETURNING id'

ERROR: relation "ir_attachment_id_seq" does not exist LINE 1: ...uid", "create_date", "write_date") VALUES(nextval('ir_attach...

                                                             ^

2018-01-04 13:16:33,915 9473 ERROR obg_prod odoo.addons.website.models.ir_http: 500 Internal Server Error:

Traceback (most recent call last):

...

Avatar
Discard

Hi,

you must have exactly the same odoo sources release for the 2 servers (no difference for odoo code between the 2 servers), and having backup your database with filestore include (backup zip), different postgresql version between the 2 servers

Bye

Best Answer

i think this error is because of the different Postgres versions of Odoo instances.
My source database postgres version is 10 and my destination (restored one) postgres version is 9.5

Avatar
Discard
Best Answer

You can try with create an SEQUENCE  " ir_attachment_id_seq" by manual for this issue:

CREATE SEQUENCE public.ir_attachment_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START (number of ir_attachment.id + 1 )
CACHE 1;


ALTER TABLE public.ir_attachment_id_seq
OWNER TO ( database account );


Regards,




Avatar
Discard