Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to upload database dump in Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 263
    Comment on it

    The upload method use this link to Upload a database dump Parameters

    key (str) -- (required) your private key
    request (str) -- (required) your request id
    request result
    Return type
    json dictionary

    The request id and the private key are obtained using the create method For example see code below.

    import os
    import pycurl
    from urllib import urlencode
    from io import BytesIO
    import json
    UPLOAD_URL = ""
    DUMPFILE = "openchs.70.cdump"
    fields = dict([
        ('request', '10534'),
        ('key', 'Aw7pItGVKFuZ_FOR3U8VFQ=='),
    headers = {"Content-Type": "application/octet-stream"}
    postfields = urlencode(fields)
    c = pycurl.Curl()
    c.setopt(pycurl.URL, UPLOAD_URL+"?"+postfields)
    c.setopt(pycurl.POST, 1)
    filesize = os.path.getsize(DUMPFILE)
    c.setopt(pycurl.POSTFIELDSIZE, filesize)
    fp = open(DUMPFILE, 'rb')
        ['%s: %s' % (k, headers[k]) for k in headers])

    Note-With the help of above method we can uploads a database dump.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: