Knowledgebase

Question About Servers

How to Increase the Database Upload Size Allowed for Odoo Front-End Print

  • 0

When you restore a database backup through the Odoo Database Manager, large backup files can fail with a 413 Request Entity Too Large error or time out partway through. This happens because Nginx limits upload size and how long it waits for Odoo to respond. This guide shows how to raise both limits.

Note: this guide assumes Odoo runs behind Nginx. If you have not set that up, see How to Setup Odoo with Nginx as a Reverse Proxy in Ubuntu.

Step 1: Connect to Your Server

Connect to your server over SSH as a user with sudo privileges.

Step 2: Edit the Nginx Site Configuration

Open the Nginx configuration file for your Odoo domain. Replace example.com with your domain:

sudo nano /etc/nginx/sites-enabled/example.com

In the server block, set client_max_body_size to a value larger than your backup file. In the location / block, raise the two proxy timeouts so Nginx keeps waiting while Odoo restores the database:

server {
    client_max_body_size 2G;
    ...
    location / {
        ...
        proxy_send_timeout 900;
        proxy_read_timeout 900;
    }
}

The timeouts are in seconds. 900 seconds is 15 minutes, which is enough for most databases. Raise it further for very large ones.

Step 3: Test and Reload Nginx

sudo nginx -t
sudo systemctl reload nginx

Step 4: Check Odoo's Own Time Limit

If Odoo runs with workers, it stops any request that runs longer than limit_time_real, which can cut off a long restore. Check your Odoo configuration file, often /etc/odoo.conf:

sudo grep limit_time_real /etc/odoo.conf

If the value is lower than the time your restore needs, raise it temporarily, for example limit_time_real = 1800, then restart Odoo. Set it back after the restore.

Step 5: Restore Your Backup

Open the Database Manager in your browser and use the Restore Database button to upload your backup:

https://example.com/web/database/manager

Very Large Databases

For backups of several gigabytes, restoring from the command line is more reliable than uploading through the browser. Our team can do this for you as part of managed Odoo hosting. To download backups instead of uploading them, see How to Increase Database Download Size for Odoo Front-End.


Was this answer helpful?

« Back

Enterprise-Grade Hardware

  • Samsung
  • Juniper
  • Western Digital
  • Supermicro
  • LSI
  • Intel
  • R1Soft Backups
  • cPanel
  • MySQL
  • Parallels
  • HP Partner