Created
December 3, 2017 10:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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