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
Go to your_odoo_instance/web/database/manager where you can see all your installed databases:
Odoo's Database Manager - Backup
You will need your defined master password for this task. If you can't remember it, have a look at your odoo.conf file in your server and check the 'admin_passwd' entry.
By using this module you can backup your database periodically
https://www.odoo.com/apps/modules/7.0/crontab_config/ (v7)
you can also test this module
https://www.odoo.com/apps/modules/6.1/db_backup_ept/ (v6 it can be miggrated to v7)
in your case you can add button to execute the function that will be executed by the schedular.
There are a lot of ways to dump the database of ODOO. You can download apps from the ODOO store for doing this automatically also. Here I can suggest an addon that will do this DATABASE AUTO Backup according to your settings Month, Day, Hour basis. This is a highly reliable and efficient way where this module can handle large databases without effecting odoo processes. ODOO DATABASE AUTOMATIC BACKUP
For backup, you can go to this link http://localhost:8069/web/database/manager
.
Important
- Before that just set your master password for your Database to avoid consequences in future.
If you want to change particular models or fields while logged in. You can do it by export/import
action provided by Odoo. After exporting data from local you can import it on your server for that you have to validate it.
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.
You can take database backup from "Database Management" in odoo..
type following link in browser,
http://localhost:8069/web/database/manager
just replace your ip and port in aboves link, you will get screen for database management, you can perform following operations related to database