Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Odoo 10 : backup and restore

Odoberať

Get notified when there's activity on this post

This question has been flagged
filestorebackuprestorerestoredbodoo10
5 Replies
32572 Zobrazenia
Avatar
Maxime MARAIS

Hi All,

Not a question, but a feedback after I encountered issues restoring an instance of Odoo on another machine.

BACKUP FROM SOURCE:

1. Dump your database

sudo -u postgres pg_dump -U postgres -E UTF-8 -F p -b -C -f <<your_backup_filename.sql>> <<your_odoo_database_name>>

Replace <<your_backup_filename.sql>> with a name of your choice and <<your_odoo_database_name>> with the name of your Odoo database. Ensure the postgres user has right permissions on the target directory (consider using /tmp/ for example)

This will produce a complete SQL dump of your Odoo database including statements to create the database itself when restoring.

2. Archive your files

$ tar -cf <<your_directory>>/odoo-filestore.tar /var/lib/odoo/.local/share/Odoo/filestore/<<your_odoo_database_name>>/
$ tar -cf <<your_directory>>/odoo-local-addons.tar /var/lib/odoo/.local/share/Odoo/addons
$ tar -cf <<your_directory>>/odoo-global-addons.tar /usr/lib/python2.7/dist-packages/odoo/addons

Make an archive of:

  • the file-store relative to your database (since Odoo 8, files are not stored in database but on the file system), replace <<your_odoo_database_name>> with the name of your Odoo database.

  • the addons downloaded from the UI (local to your Odoo instance),

  • the global addons available with all your Odoo instances.

RESTORE ON TARGET:

1. Stop Odoo

/etc/init.d/odoo stop

2. Expend file archives

Remove folder /var/lib/odoo/.local/share/Odoo/filestore/<<your_odoo_database_name>>/

Remove folder /var/lib/odoo/.local/share/Odoo/addons

Remove folder /usr/lib/python2.7/dist-packages/odoo/addons

$ tar xvf <<archive-name.tar>>

Expend all 3 archives and move directories on the target machine to their respective locations .

3. Restore database

$ sudo -u postgres psql
postgres=# DROP DATABASE <<your_odoo_database_name>>
postgres=# \i <<path_to/your_backup_filename.sql>>
postgres=# \q

Connect to your PostgreSQL server, drop the current database and import your database dump. This file will create the database and make it owned by user odoo.

4. Update your filestore

$ sudo -u odoo odoo -c /etc/odoo/odoo.conf -u all

Start Odoo from command line as user odoo and force update (-u all option), then browse to your Odoo server from http://<<your_odoo_url>>:<<your_odoo_port>>. Example : http://127.0.0.1:8069.

The first request will require a little moment to run: Odoo proceeds to an complete update.

When done, type CTRL+C to stop Odoo.

$ /etc/init.d/odoo start

Restart odoo as a daemon. Done. \o/


4
Avatar
Zrušiť
Ermin Trevisan

Thanks for the write up. For the next time, it would be better to create it as a Q&A, like here: https://www.odoo.com/forum/help-1/question/ubuntu-16-04-how-to-install-sass-for-odoo-123090 .

Ermin Trevisan

What I'm looking for since a long time: how is it possible to restore a database without stopping Odoo?

Avatar
Maxime MARAIS
Autor Best Answer

@F. P.,

The SQL script generated by pg_dump restores the database ownership when recreating the database (-C option).

@Ermin Trevisan

Odoo keeps data in memory cache for performance considerations. Some data may not be saved yet on the source, some data in memory may differ from those in the database on the target. Trying to backup or restore Odoo database without stopping the application before may lead to data inconsistencies or data losses. Do always stop Odoo before doing maintenance operations on its database.

1
Avatar
Zrušiť
Avatar
Fatih Piristine
Best Answer

 nice write up. one thing: when db owner changes, odoo will give you access errors. need to run change owner queries in db to get rid of them.

2
Avatar
Zrušiť
Avatar
Hilar Andikkadavath
Best Answer

This addon do Automatic Backup DB and Filestore separate to the specified path.

Available Backup DB/Filestore Modes:

  • Local
  • Remote Server
  • Google Drive
  • Dropbox

Module For backup ODOO databases and automating the backup process of ODOO.

  • Multiple Backup Modes
  • Filestore Backup
  • Backup ODOO Databases in specified path
  • Detailed Message Log
  • Backup Status Information and History
  • User can select the format to dump, either custom archive, plain text SQL or tar archive
  • Archive Backup Process
  • Repeat Missed Backup Process

Features

  • Dump ODOO Database in specified format
  • Output a custom archive suitable for input into pg_restore. This is the most flexible format in that it allows the reordering of loading data as well as to object definitions. This format is also compressed by default. Here we user gzip ie, test.gz, We also recommend you to select Custom, because Using the custom format you can restore single objects from a backup.
  • Output a plain-text SQL script file (the default). The plain text format is useful for very small databases with a minimal number of objects but other than that, it should be avoided.
  • Output a tar archive suitable for input into pg_restore. Using this archive format allows reordering and/or exclusion of database objects at the time the database is restored. It is also possible to limit which data is reloaded at restore time. we use tar with gzip
  • Backup Filestore
  • Multiple backup modes at sametime

https://apps.odoo.com/apps/modules/13.0/auto_backup_odoo/

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Restore completes but database not visible Solved
backup restore restoredb
Avatar
Avatar
Avatar
3
jan 22
5962
Odoo Database error Solved
postgresql backup restore odoo10
Avatar
1
dec 21
11193
How to restore and backup db, all collaterals, and restore via script to fresh server? Solved
filestore backup restore bash
Avatar
Avatar
Avatar
2
dec 19
30399
Error in odoo 12 after restoring database, ProgrammingError: relation "ir_attachment_id_seq" does not exist Solved
database backup restore restoredb odoo12
Avatar
Avatar
Avatar
Avatar
Avatar
6
okt 25
9924
How to make snapshots of the Odoo online configuration and restore them?
backup restore restoredb databasebackup snapshot
Avatar
0
apr 24
3051
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now