Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Automate Odoo V8 Databases Backup

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
scriptbackupodooV8
3 Odpowiedzi
5764 Widoki
Awatar
Ayham

I know that there is a module for auto backup and it was work well for me but know it makes issues with the Pysftp since Odoo with the new updates not recognize that Pysftp is installed so that I decided to make a script for automating backing up on Ubuntu Server.

This is my script:


# Backup script starts here.

#To stop Odoo service

sudo service odoo stop

#!/bin/bash

# Location of the backup logfile.

logfile="/var/odoo/log/logfile.log"

# Location to place backups.

backup_dir="/var/odoo/backups"

touch $logfile

timeslot=`date +%d-%m-%y-%H-%M-%S`

databases=`psql -U postgres -q -c "\l" | awk '{ print $1}' | grep -vE '^\||^-|^List|^Name|template[0|1]|^\('`

for i in $databases; do

timeinfo=`date '+%T %x'`

echo "Backup and Vacuum started at $timeinfo for time slot $timeslot on database: $i " >> $logfile

/usr/bin/vacuumdb -z -U postegres $i >/dev/null 2>&1

/usr/bin/pg_dump $i --port 5432 -U postgres --format=c --blobs --verbose | gzip > "$backup_dir/odoo-$i-$timeslot-database.gz"

timeinfo=`date '+%T %x'`

echo "Backup and Vacuum complete at $timeinfo for time slot $timeslot on database: $i " >> $logfile

done

#-------------------------------------------------

# delete backups more than 30 days old

find $backup_dir/Odoo* -mtime +30 -exec rm {} \;

#To start Odoo service

sudo service odoo start


#END


This script is making backups for all existing databases, but when try to restore any of them it gives me that restore unsuccessful, and when try to restore them by pg_restore command it gives me that the archive is not correct.

The backup file that generated from the web manager backup tool consist of several files but the backup that generated by pg_dump consist from only one file.

Any one can help! 

0
Awatar
Odrzuć
wizardz

I tryed to install the auto_backup modul. I have installed the pysftp but when I'm adding the auto_backup module, it says: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi execute(self.server.app) File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute application_iter = app(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/service/server.py", line 290, in app return self.app(e, s) File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 216, in application return application_unproxied(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 202, in application_unproxied result = handler(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1289, in __call__ self.load_addons() File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1310, in load_addons m = __import__('openerp.addons.' + module) File "/usr/lib/python2.7/dist-packages/openerp/modules/module.py", line 80, in load_module mod = imp.load_module('openerp.addons.' + module_part, f, path, descr) File "/opt/custom_addons/auto_backup/__init__.py", line 23, in import backup_scheduler File "/opt/custom_addons/auto_backup/backup_scheduler.py", line 33, in raise ImportError('This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)') ImportError: This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)

Awatar
Andre de Kock
Najlepsza odpowiedź

If you make backups, the best way to do it, I've found, is:

pg_dump --host=$HOST_A --username=$USER_A --verbose $DB_NAME > /tmp/$DB_NAME.backup

And to restore:

createdb --host=$HOST_B --username=$USER_B $DB_NAME

psql --host=$HOST_B --username=$USER_B $DB_NAME < /tmp/$DB_NAME.backup

@Keng Onn:

I solved this by ensuring that any files uploaded to Odoo (any ir.attachment) is stored in the database. You do this by setting an ir.config_parameter called "ir_attachment.location" to "db". The default value is "file" which means that Odoo will by default store ir.attachment objects in the filestore.

1
Awatar
Odrzuć
Keng Onn

thanks for illustrating how you solve this :), but how do you tackle the filestore issue? as in, how to restore other stuff that is not stored in the DB? As well as meta-info such as the modules installed, etc?

Andre de Kock

@Keng Onn: see updated anwer

Awatar
Ayham
Autor Najlepsza odpowiedź

#Andre

Dear, I tested the commands, but when making restore the database not appeared    in the web manager page.


#Ahmed

Yes dear I checked the mentioned link before, all mentioned methods in the scripts have issues

0
Awatar
Odrzuć
Awatar
Qutechs, Ahmed M.Elmubarak
Najlepsza odpowiedź

Dear Ayham,

Kindly check this link , if you didn't already ...

Kind Regards,


0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Can't install auto_backup module Rozwiązane
backup odooV8
Awatar
Awatar
Awatar
Awatar
Awatar
16
wrz 20
23086
Alternates to backup?
backup odooV8
Awatar
Awatar
Awatar
3
wrz 17
3941
Back up from Command
backup odooV8
Awatar
Awatar
2
lut 16
4753
Need an explanation of backup formats
format backup odooV8
Awatar
1
mar 19
6221
Backupscript for database + filestore
filestore script backup
Awatar
Awatar
1
sie 15
8091
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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