Hi
BloomOn Design Agency,
Restoring an Odoo 18 Enterprise database from a cloud backup to a local instance requires several precise steps to ensure that everything, including the database, filestore, and configuration, is set up correctly. Below is a detailed guide to help you troubleshoot and fully restore your Odoo database locally.
Step-by-Step Guide to Restoring Odoo 18 Enterprise Locally
1. Download the Backup from Odoo Cloud
Since you've already downloaded the .dump.zip file and extracted it, you should have:
-
dump.sql (PostgreSQL database)
-
filestore/ (attachments, images, files)
-
(Optional) manifest.json (backup metadata)
2. Restore the Database in PostgreSQL
To restore your database properly, follow these steps:
Step 2.1: Create a New Database
-
Open pgAdmin or use the command line.
-
Create a new database in PostgreSQL using the same encoding and collation:
CREATE DATABASE odoo18_local WITH OWNER odoo ENCODING 'UTF8' TEMPLATE template0;
-
Replace odoo18_local with your actual database name.
-
Replace odoo with your PostgreSQL user.
Step 2.2: Restore the Database from dump.sql
Use the following command in the terminal:
psql -U odoo -d odoo18_local -f dump.sql
3. Restore the Filestore
Odoo stores attachments and images separately from the database. You must copy the extracted filestore/ directory to Odoo's local data directory.
Locate Your Odoo Data Directory
Copy the Filestore
Ensure the filestore matches the name of the database:
cp -r filestore/ ~/.local/share/Odoo/filestore/odoo18_local/
(Change odoo18_local to your actual database name.)
4. Update Odoo Configuration
Edit your odoo.conf file to point to the restored database.
Find the Configuration File
Modify the Configuration
Ensure it includes:
[options]
db_host = localhost
db_port = 5432
db_user = odoo
db_password = yourpassword
addons_path = /opt/odoo/addons,/opt/odoo/custom_addons
data_dir = /home/odoo/.local/share/Odoo
Restart the Odoo service after updating the configuration:
sudo systemctl restart odoo
5. Debugging Issues After Restoration
If Odoo starts but has missing attachments or errors:
-
Check Logs: Run Odoo with logging enabled:
./odoo-bin --log-level=debug
-
Update Filestore Permissions:
sudo chown -R odoo:odoo ~/.local/share/Odoo/filestore/
sudo chmod -R 755 ~/.local/share/Odoo/filestore/
-
Check Installed Modules:
If you get module errors, run:
./odoo-bin -c odoo.conf -u all
This updates all modules.
6. Verify Everything
-
Log in to Odoo at http://localhost:8069.
-
Check if attachments load correctly.
-
Review logs for any errors.
Final Thoughts
✅ Common Issues and Fixes
Problem | Solution |
---|
Database restore error | Ensure the PostgreSQL role exists and use psql for restoring. |
Missing attachments/images | Ensure the filestore is copied and permissions are correct. |
Website layout missing | Update modules with -u all and clear the cache. |
Odoo fails to start | Check odoo.conf and restart the service. |
Method 2: Restore via Odoo UI (/web/database/manager)
If you want a more user-friendly way to restore your database, follow these steps:
1. Open Odoo Database Manager
-
Start your local Odoo instance.
bash
sudo systemctl start odoo # For Linux
net start odoo18 # For Windows (if installed as a service)
-
Open your web browser and go to:
bash
http://localhost:8069/web/database/manager
2. Restore the Database
-
Click on "Restore Database".
-
Choose the .zip file you downloaded (.dump.zip).
-
Enter a new database name (e.g., odoo18_local).
-
Master Password:
-
This is defined in your Odoo configuration file (odoo.conf).
-
If you haven't set one, you need to find or set it manually.
3. Finding or Setting the Master Password
Option 1: Check Existing Configuration
Option 2: Set a New Master Password
If you don’t know it, set a new one in odoo.conf:
ini
admin_passwd = newpassword
Then restart Odoo:
bash
sudo systemctl restart odoo # Linux
net stop odoo18 && net start odoo18 # Windows
4. Final Steps
-
After restoring, log in with your existing Odoo admin credentials (from the cloud version).
-
Verify that everything (modules, filestore, customizations) is working.
-
If attachments are missing, manually copy the filestore as explained in the first method.
Comparison of Both Methods
Method | Pros | Cons |
---|
pgAdmin / psql (CLI) | More control, useful for debugging errors | Requires PostgreSQL knowledge |
Odoo Web UI (/web/database/manager) | Easy, no command-line required | Requires correct master password |
Thanks & Regards,
Sunny Sheth