Odoo Database Backup & Restore

 Steps:

  1. Go to the Manager Link
  2. Set Master Password
  3. Backup the database
  4. Restore the database
  5. Delete the old database


Go to following URL


 


Click on "SET MASTER PASSWORD" Set the master password for first time.

 




Backup the databae:

 





Restore:

Click on restore to give new name to database and add backup file that you download when you click on Backup



 





If you get any error related to Command pg_dump not found
Add following line in the odoo.config file
pg_path = C:\Program Files\PostgreSQL\10\bin  
# this is the postgre bin path



 

Using Command Line

Through command line some time create CSS error when you log in to Odoo (mostly do not use this)

To Backup the Database:

  1. login the Linux
  2. open terminal by pressing "Ctrl+Alt+t"
  3. Run the following commands in terminal

>> sudo su - odoo -s /bin/bash                                    // odoo is linux user     

                   

>> pg_dump databasename > db_back/anyname.dump             //  command databasename>foldername/filename.dump

  1. Open Files, the backup will be available at the db_back directory
  2. Copy the backup.dump file and save it in some external drive.

 

 

 

To Re-Store the Database:

  1. login the Linux
  2. open terminal by pressing "Ctrl+Alt+t"
  3. move/copy the backup file (".dump") at the home directory
  4. Run the following commands in terminal one by one

            >> sudo -u postgres psql

            >> CREATE DATABASE databasename OWNER = server;

//first create the new database

            >> .\q

 //exit form psql

Go directly to the user folder and past the backup and then use the command to restore the database.

 

            >> psql newdatabsename < filename.dump


            >> exit


Comments

Popular posts from this blog

temp