Odoo Database Backup Restore
Take backup of all the custom modules
Goto you custom module folder
cd /path/to/your/custom/modules
Example:
cd /odoo18/custom
Convert your desired folder to zip
sudo apt install zip unzip
zip -r filename.zip folder
1. Take Backup of Database
Goto server using ssh
Goto your postgres user
Goto psql server
Check list of database you have
Came back to the psql server and Dump the desired database
pg_dump database_name > database_name_20160527.sql
2. Now take backup of filestore
Goto the filestore folder using cd
cd /path/to/your/filestore
Example:
cd /odoo18/.local/share/Odoo/filestore
Convert your desired folder to zip (Please zip the that match with your database name)
sudo apt install zip unzip
zip -r filename.zip folder
You are done with taking Backup of your databse its time to upload
1. Upload filestore and dumped.sql file
Use FileZilla for uploading zipped filestore and dumped.sql file
Goto the server where you want to restore using ssh
Goto the folder you have uploaded zip and sql file using cd
cd /path/to/your/zip/and/sql/file
Example:
cd /odoo
Unzip filestore and move to specific folder
Unzip the filestore
unzip filename.zip
Example:
unzip production.zip
Move the file to filestore
sudo mv unzipped_folder_name/ /path/to/your/filestore
Example
sudo mv filestore/ /odoo/.local/share/Odoo/filestore
Now creating the database and uload psql file
Goto server using ssh
Goto your postgres user
Goto the folder you have sql file
cd /path/to/your/uploaded/sql/file
Example
cd /odoo
Create Database and Upload
createdb -O db_user dbname
Example:
createdb -O odoo Sakan.live
psql db_name < sql_file_you_want_to_upload
Example:
psql Sakan.live < sakan.sql
Its Time to Setup PDF Report
Go to settings > Technical > Parameters > System parameters
Make a new paramater
a. Name: web.base.url.freeze
b. Value: True
Edit the parameter web base.url and place the ip on http://0.0.0.0:8069
Refresh and everything is fixed.
Still you may face some problem to show image if yes here is the solution
sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt install -f