Backup Odoo db from within odoo

后端 未结 8 864
北恋
北恋 2021-01-11 14:22

I need to backup the current db while logged into odoo. I should be able to do it using a button, so that suppose I click on the button, it works the same way as odoo defaul

8条回答
  •  失恋的感觉
    2021-01-11 15:11

    You can use the CURL to download the full backup (assets + DB), this method is comparatively faster than pg_dump.

    curl -X POST \
    -F "master_pwd=${ADMIN_PASSWORD}" \
    -F "name=${ODOO_DATABASE}" \
    -F "backup_format=zip" \
    -o ${BACKUP_DIR}/${ODOO_DATABASE}.$(date +%F-%T).zip \
    ${HOST}/web/database/backup
    

    You can wrap inside a custom (your own) Odoo add-on if you wish to. Hope this helps.

提交回复
热议问题