This question has been flagged
3 Replies
12088 Views

Hello, 

I launched the following command pg_dump for the backup of the database but it displays this error can help me please on this point

The error: 

pg_dump: Dumping the contents of table "ir_attachment" failed: PQgetCopyData() failed.

pg_dump: Error message from server: server closed the connection unexpectedly

        This probably means the server terminated abnormally

        before or while processing the request.

pg_dump: The command was: COPY public.ir_attachment (id, name, datas_fname, description, res_name, res_model, res_model_name, res_field, res_id, company_id, type, url, public, access_token, db_datas, store_fname, file_size, checksum, mimetype, index_content, active, create_uid, create_date, write_uid, write_date, key, website_id, theme_template_id, attachmenet_type_id, arp_flag, date_report, decision_attachment_id, version_id, law_project_id, law_project_version_id, bo_project_id, meeting_id, titre_rapport, remarque, bo_project_version_id) TO stdout;


and in the odoo logs file I found the following errors: 

2020-03-18 09:45:19,177 25363 ERROR arabe_arp_serv_v19 odoo.sql_db: bad query: INSERT INTO "ir_attachment" ("id", "create_uid", "create_date", "write_uid", "write_date", "active", "arp_flag", "company_id", "datas_fname", "mimetype", "name", "public", "res_id", "res_model", "type", "website_id") VALUES (nextval('ir_attachment_id_seq'), 1, (now() at time zone 'UTC'), 1, (now() at time zone 'UTC'), true, false, 1, 'web.assets_frontend.0.css', 'text/css', '/web/content/css', true, 0, 'ir.ui.view', 'binary', 1) RETURNING id
ERROR: cannot execute INSERT in a read-only transaction


please help me ??

Avatar
Discard

please update the command you tried.

Author

Hello,

pg_dump -U odoo -p 5000 -h IP_adress -d arabe_arp_serv_v19 -W > arabe_arp_serv_v19_31032020.dump

Author

Hello,

any answer please , i need a help ,

Best Answer

We can Backup the odoo database in several ways. We can easily back up the database and restore the database from the odoo front end.


To do so, go to the database manager option (<odoo-url>/web/database/manager) and click the backup button.


 


If you set a master password it will ask the master password first, later select the backup format.


In Odoo, there comes mainly two types of backup format.


1. zip(Include filestore)

2. pg_dump custom format (without filestore)


Upon selecting the first option, it will generate a zip file containing a file store, dump.sql, and manifest.json.


Where, filestore contains all the static files stored on disk such as images, attachments, the dump.sql file mainly contains all the (Postgresql backup) data and the manifest.json file contains the list of modules, Odoo version, database name, Postgresql version and more.

Either you can restore the database from the front end or you can restore the database from the terminal.

Avatar
Discard
Best Answer

Odoo Backup database : 



Avatar
Discard
Author Best Answer

Hello Imran, 

Thanks for your feedback

but, if we run a backup from the odoo front-end,

Where we can find the backup after, 


regards, 

 
Avatar
Discard

Please watch this video https://www.youtube.com/watch?v=vnvc0a0d44s if you have any further question please feel free to ask me.

Author

hello Imran

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

please can you help me

Hi,

In my case I had added one test table while was causing this issue then I had dropped that table as seems any object creation you might need to register or update scripts. Hope this will help. thanks