Odoo database restore problem workaround
This is a workaround for odoo database restore problem can occur.
I’ve found it on this thread and it works and can save you a ton of time.
Starting from an Odoo db backup, made directly from odoo UI db manager (…/web/database/manager).
Sometimes can occur an error like:
odoo relation “ir_attachment_id_seq” doesn’t exist
This is due to different postgres engine versions, e.g.: 9.5 against 10
A workaround effectively works is to extract all files from the zip, the open file dump.sql and replace all occurrences of text: AS integer
with an empty string.
Then you have to take again all the files, included the filestore folder, the manifest.json and the modified version of dump.sql, and make the zip to restore from: http://yourOdooAddress/web/database/manager
Tested on Odoo 11 and Odoo 12 but maybe it works also on other versions.