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 https://upgrade.odoo.com/database/v1/upload/ use this link to Upload a database dump Parameters

    key (str) -- (required) your private key
    request (str) -- (required) your request id
    Returns
    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 = "https://upgrade.odoo.com/database/v1/upload"
    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')
    c.setopt(pycurl.READFUNCTION, fp.read)
    c.setopt(
        pycurl.HTTPHEADER,
        ['%s: %s' % (k, headers[k]) for k in headers])
    
    c.perform()
    c.close()
    

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

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
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: