Odoo Database Upgrade FAQ

7. Is there an alternative method like SFTP to upload my database?

Yes, you can use SFTP to upload your database dump but you'll need to use the upgrade API instead of the html form.

You need to create a script (bash, python, ...) using the documentation from:
https://www.odoo.com/documentation/9.0/reference/upgrade_api.html

You'll need to call 3 methods:

  1. 'create':
    will give you information about your upgrade request, the most useful will be:
    • the request ID
    • the private key
  2. 'request_sftp_access':
    will give you the required parameter to connect to the SFTP server
  3. 'process':
    will actually start the migration process

You will upload your database (using the 'sftp' command line tool for example) between method n°2 and method n°3.

An important note: do not forget to call the 'process' method, otherwise your request will stay in 'draft' state and you will never receive your upgraded database.

You can find a sample script here:
https://gist.github.com

Here is an example of use:
CONTRACT=M1234-abcd EMAIL=abc@example.com AIM=test TARGET=10.0 DUMP=/path/to/dbdump.sql.gz bash odoo_upgrade_request.sh

You should have a valid SSH public key at:
${HOME}/.ssh/id_rsa.pub