Skip to content

Instantly share code, notes, and snippets.

@bluemix
Created December 3, 2017 10:09
Show Gist options
  • Save bluemix/edbac4073e89fd9763692fe2b5fff7ae to your computer and use it in GitHub Desktop.
Save bluemix/edbac4073e89fd9763692fe2b5fff7ae to your computer and use it in GitHub Desktop.
A Python script to make a database backup for Odoo 9, 10, and 11
import base64
import xmlrpclib
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/db')
# backup will be saved to backup.dump file
backup_file = open('backup.dump', 'wb')
# database name: auc_odoo_db
# database master password: admin
# backup format: zip
backup_file.write(base64.b64decode(sock.dump('admin','auc_odoo_db', 'zip')))
backup_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment