Backing up Odoo db from the inside

I need to backup the current db during login. I have to do this with a button, so suppose I click on a button, it works just like the default backup in database management, but I should be able to do this from the inside during login.

Is there any way to achieve this? I know this is possible due to an external ode using bash, but that is not what I want.

+8
source share
7 answers

Using this module, you can periodically back up your database

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 ported to v7)

in your case, you can add a button to execute a function that will be executed on a schedule.

+4
source

You can use a private browser session to access the "Database" menu, from the login screen and execute the backup form (you need to know the main password to access this, defined in the server configuration file).

+1
source

Go to your_odoo_instance / web / database / manager , where you can see all the databases you installed:

Odoo Database Manager - Backup

To complete this task, you will need your primary password. If you cannot remember it, look at your odoo.conf file on your server and check the entry "admin_passwd".

+1
source

You can take a database backup from "Database Management" in odoo ..

enter the following link in the browser,

http: // localhost: 8069 / web / database / manager

just replace the link with your ip and port in the aboves, you will get a screen for managing the database, you can perform the following operations related to the database

  • Create
  • Duplicate
  • A fall
  • Backup
  • Password
  • Recovery
+1
source

Add a button somewhere and call a controller like this.

@http.route('/backup/download', auth="user", type='http') def backup(self, **kw): ts = datetime.datetime.utcnow().strftime("%Y-%m-%d_%H-%M-%S") filename = "%s_%s.zip" % (request.env.cr.dbname, ts) headers = [ ('Content-Type', 'application/octet-stream; charset=binary'), ('Content-Disposition', content_disposition(filename)), ] dump_stream = db.dump_db(request.env.cr.dbname, None) response = werkzeug.wrappers.Response(dump_stream, headers=headers, direct_passthrough=True) return response 
0
source

You can use CURL to load a 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 it in your own Odoo add-on if you want. Hope this helps.

0
source

For backup, you can follow this link http://localhost:8069/web/database/manager .

  • You can back up from there.
  • You can also restore a preliminary backup.

Important - Before doing this, simply set your primary password for your database to avoid future consequences.

enter image description here If you want to change certain models or fields during login. You can do this with the export/import action provided by Odoo. After exporting data from the local server, you can import it to your server to check it. enter image description here

-3
source

Source: https://habr.com/ru/post/980963/


All Articles