Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
404 Visualizzazioni

Hello everyone,

I'm facing an issue while trying to restore a database in my Odoo instance.

I created a backup from the Odoo web interface (file: odoodb.zip) using the database manager. Now I’m trying to restore this backup on the same Odoo instance.

However, when I try to import it, I get the following error in the web interface:

Database restore error: Database already exists

And in the terminal, I see the following log:

2025-04-23 10:30:19,568 8369 INFO testdb odoo.service.db: RESTORING DB: odoodb 
2025-04-23 10:32:20,660 8369 WARNING ? odoo.service.server: Thread , <Thread(odoo.service.http.request.140697989527104, started 140697989527104)> virtual real time limit (168/120s) reached. 
...
odoo/service/db.py", line 326, in restore_db
  r = subprocess.run(
...
subprocess.py", line 1260, in wait
  return self._wait(timeout=timeout)

Additional information:

  • I’m restoring the database through the web interface at: http://<my-ip>:8069/web/database/restore
  • The database name I’m trying to restore does not currently exist (or shouldn't).
  • The restoration process seems to hang until it reaches the virtual real time limit.

Note:

The database did not exist before I attempted the restore. The PostgreSQL server contains no other custom databases — only the default ones created by the system.

My questions:

  • How can I properly restore a .zip database backup if it supposedly doesn’t already exist?
  • Could this be a caching or permission issue?
  • Are there any recommended best practices when restoring database backups in Odoo?

Thanks in advance for your help!

Avatar
Abbandona
Risposta migliore

Hello Tuni ERP, 


This issue can sometimes occur if the database backup is large or if the web interface reaches a timeout during the restore process.

If you're encountering a server time out error, you can adjust the time limits in your Odoo configuration file (odoo.conf) by adding the following parameters: 

    limit_time_cpu = 1200

    limit_time_real = 1200

These settings increase the allowed processing time and can help with large database restores.

If you're using a Linux-based system like Ubuntu, it's generally more reliable to restore the database via the terminal instead of the web interface.

 Here’s a step-by-step guide:

1. Unzip your .zip backup file — it typically contains a .sql dump file inside.

2. Create a New PostgreSQL Database

    - Open a terminal and run the following command to create a new empty database (replace your_database_name with your preferred name):

createdb your_database_name

 3. Restore the SQL Dump

   - Use the following command to restore the .sql file into the new database:

psql your_database_name < /full/path/to/your_dump_file.sql

Make sure to replace the path with the actual location of your dump file. 

Once completed, your database should be restored and accessible via your Odoo instance.

Feel free to reach out if you have any questions or run into issues - happy to help !! 


Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

Avatar
Abbandona
Risposta migliore

From the logs, it is evident that when you try to restore a db, the thread reaches a time limit and is killed. In order to fix this try setting the limit_time_cpu and limit_time_real parameters in your odoo-sever.conf file. You will find a lot of examples of these in other posts. Let us know if it works. Thank you

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
10
gen 21
77664
3
giu 16
6740
1
mag 16
7740
0
apr 24
1345
1
gen 23
4528