How to Restore a Database in Odoo 18 ERP: Complete Step by Step Guide
By Braincuber Team
Published on March 31, 2026
In any ERP system, safeguarding and restoring data are essential for maintaining operational continuity and preventing data loss. Odoo 18 ERP continues to offer flexible and powerful tools for managing database backups and restoration. With slight refinements in the interface and improved backend performance, Odoo 18 makes the process even more seamless. This complete tutorial will walk you through how to restore a database in Odoo 18, using both the Odoo web interface and the terminal (command-line).
What You'll Learn:
- How to prepare a valid backup file from Odoo 18 Database Manager
- Understanding ZIP vs Custom Dump backup formats and their contents
- Restoring databases via the Odoo web interface with neutralization options
- Restoring from ZIP and dump files using terminal commands
- Troubleshooting common permission denied errors on dump.sql files
- Verifying successful database restoration and accessing restored data
Understanding Backup Formats in Odoo 18
Before you can restore anything, you need a valid backup file. Odoo 18 allows you to create backups in two formats, each serving different purposes. Understanding the differences between these formats is crucial for choosing the right restoration method.
| Format | Contents | Best For |
|---|---|---|
| ZIP Format | dump.sql, filestore/, manifest.json | Complete restoration with attachments |
| Custom Dump | PostgreSQL dump only (no filestore) | CLI restoration, database-only restore |
The .zip file typically includes three critical components: dump.sql (PostgreSQL database dump), filestore/ (binary files like images and attachments), and manifest.json (metadata for Odoo to recognize the backup). The filestore is essential for preserving all uploaded documents, product images, and email attachments.
Step 1: Preparing Your Backup File
Before restoring a database, you need to create a valid backup from your existing Odoo 18 instance. This can be done through the Odoo Database Manager interface, which provides a straightforward way to export your complete database.
Access Database Manager
Navigate to https://yourdomain.com/web/database/manager to access the Odoo Database Manager interface.
Create Backup
Click the Backup button, enter the Master Password, and choose your preferred format (ZIP or Custom Dump). Click Backup to download the file.
Master Password Required
You must know the Master Password for your Odoo instance to create or restore backups. This password is configured in the odoo.conf file under the admin_passwd parameter. Without it, you cannot access the Database Manager functions.
Step 2: Restoring via the Odoo Web Interface
This is the easiest and most accessible method for most users. The web-based restoration process handles all the complex database operations automatically, making it ideal for functional users and administrators who prefer a graphical interface.
Open Database Manager
Open your browser and go to https://yourdomain.com/web/database/manager to access the restoration interface.
Upload and Restore
Click Restore, enter the Master Password, upload your .zip backup file, choose a new database name, and click Continue.
Unique Database Name Required
The database name must not conflict with an existing one. Choose a unique name to avoid overwriting. Odoo will automatically check for conflicts and alert you if the name already exists.
Using the Neutralize Option
The Neutralize option is useful when you're restoring a production database into a development or staging environment. When enabled, it helps prevent unintended behavior by performing several safety measures.
Remove User Emails
Removes all user email addresses except for the admin to prevent accidental communications.
Disable Outgoing Emails
Disables all outgoing email functionality to prevent test emails from reaching real customers.
Disable Scheduled Tasks
Turns off automated actions like scheduled tasks (cron jobs) to prevent unintended data processing.
Safe Testing Environment
Use this when you want to safely test or debug a copy of your live system without affecting real users.
Odoo will unpack the contents, recreate the database, and restore your data automatically. The entire process is handled in the background, and you'll receive a notification when the restoration is complete.
Step 3: Restoring Using the Terminal (Advanced Users)
For developers and sysadmins, restoring from the terminal offers more control, especially in staging or production environments. This method is essential when working with large databases or when the web interface is not accessible.
Method A: Restore from a ZIP Backup
When restoring from a ZIP file, you need to extract the contents first, then manually restore the database and filestore separately.
Extract the ZIP File
Unzip the backup file to a dedicated folder to access the dump.sql and filestore contents.
Create New Database
Switch to PostgreSQL superuser and create a new blank database owned by the Odoo user.
Restore SQL Data
Use psql to import the dump.sql file into the newly created database.
# Step 1: Unzip the backup file
unzip backup_odoo18.zip -d restore_folder
# Step 2: Switch to PostgreSQL superuser
sudo su postgres
# Step 3: Create a new database owned by the Odoo user
createdb -U postgres -O odoo_user database_name
# Step 4: Restore SQL data
psql -U postgres -d database_name -f dump.sql
If the restoration process is working correctly, you will see several lines in the terminal output that look like ALTER TABLE. This indicates that the SQL schema is being properly applied to the new database. Make sure the restored database is referenced correctly in your odoo.conf file if needed.
Method B: Restore from a Dump File (Custom Format)
Restoring a .dump file (created using the pg_dump custom format) is ideal when your backup doesn't include attachments or filestore data. This method uses pg_restore for more efficient database restoration.
Save Dump File
Move or save your .dump file in a dedicated folder for easy access during restoration.
Switch to PostgreSQL User
Open your terminal from the folder and enter the PostgreSQL superuser environment with sudo su postgres.
Create Blank Database
Create a new blank database and assign it to your Odoo user using createdb command.
Restore with pg_restore
From the same directory where the .dump file is located, run pg_restore to import the database.
# Step 1: Navigate to the dump file folder
cd /path/to/dump/folder
# Step 2: Switch to PostgreSQL user
sudo su postgres
# Step 3: Create a new blank database
createdb -U postgres -O odoo_user database_name
# Step 4: Restore using pg_restore
pg_restore -d database_name dump_file_name.dump
# Example:
pg_restore -d odoo18_restored db_pos_repeat_order_2025-06-02_09-48-04.dump
Replace odoo_user with Your Actual User
Replace odoo_user with your actual Odoo PostgreSQL user if it's different. You can find this in your odoo.conf file under the db_user parameter.
Step 4: Troubleshooting Common Permission Issues
One of the most common issues when restoring databases via terminal is the "Permission Denied" error on dump.sql files. Even if your dump.sql file is readable, PostgreSQL must also have permission to access all parent directories leading to the file. This is especially relevant when running the psql command as the postgres user.
Check Directory Permissions
Run ls -ld on each directory in the file path to verify the postgres user has traverse (x) permissions.
Fix Missing Permissions
If any directories are missing x permissions, use chmod +x to add traverse permissions for the postgres user.
# Check directory permissions
ls -ld /path/to/your/home
ls -ld /path/to/your/home/Downloads
ls -ld /path/to/your/home/Downloads/restore_folder
# Fix missing x (traverse) permissions
chmod +x /path/to/your/home
chmod +x /path/to/your/home/Downloads
chmod +x /path/to/your/home/Downloads/restore_folder
You should see the x (execute) permission in the output — this allows the postgres user to traverse the directory. Replace /path/to/your/... with your actual directory path. Without proper traverse permissions on all parent directories, PostgreSQL cannot access the dump file even if the file itself has correct permissions.
Step 5: Verifying the Restored Database
After completing the restoration process, you need to verify that the database was restored correctly and is accessible. This final step ensures that all your data, configurations, and customizations are intact.
Access Restored Database
Open your browser and navigate to https://yourdomain.com/?db=database_name to access the restored database.
Verify Data Integrity
Check key modules, records, and configurations to ensure all data was restored correctly and completely.
| Verification Item | What to Check |
|---|---|
| User Access | Log in with admin credentials and verify user list is intact |
| Installed Modules | Check Apps menu to confirm all modules are installed and updated |
| Business Data | Verify sales orders, invoices, inventory, and other critical records |
| Filestore Attachments | Check that product images, documents, and email attachments are accessible |
| Custom Configurations | Verify custom fields, views, workflows, and automation rules |
Update odoo.conf if Necessary
If you're replacing a production database, update the db_name parameter in your odoo.conf file to point to the restored database. Restart the Odoo service after making this change to apply the new configuration.
Best Practices for Database Restoration
Following best practices ensures successful database restoration and minimizes the risk of data loss or corruption. These guidelines apply whether you're restoring via the web interface or terminal.
Test Restorations Regularly
Periodically test your backup files by restoring them to a staging environment to verify they work correctly.
Use Neutralize for Testing
Always enable the Neutralize option when restoring production data to development or staging environments.
Maintain Backup Schedule
Set up automated daily backups and store them in multiple locations for disaster recovery.
Secure Master Password
Store the Odoo master password securely and restrict access to the Database Manager interface.
Frequently Asked Questions
What is the difference between ZIP and dump backup formats?
The ZIP format includes the complete database dump.sql, filestore (attachments and binary files), and manifest.json metadata. The Custom Dump format only contains the PostgreSQL database dump without filestore, making it smaller but incomplete for full restoration.
What does the Neutralize option do during restoration?
Neutralize removes user email addresses (except admin), disables outgoing emails, and turns off scheduled tasks (cron jobs). This prevents a restored production database from accidentally sending emails or running automated processes in a test environment.
Why am I getting Permission Denied when restoring dump.sql?
PostgreSQL needs execute (x) permissions on all parent directories leading to the dump.sql file. Run chmod +x on each directory in the path to grant traverse permissions to the postgres user.
Can I restore a backup to the same database name?
No, you must use a unique database name to avoid conflicts. If you want to replace an existing database, first delete the old one from the Database Manager, then restore with the original name.
How do I access the restored database after terminal restoration?
Access the restored database by navigating to https://yourdomain.com/?db=database_name in your browser. Replace database_name with the name you used during the createdb command.
Need Help with Odoo Database Management?
Our experts can help you set up automated backup strategies, implement disaster recovery plans, and optimize your Odoo 18 database performance for maximum reliability.
