Code Monkey home page Code Monkey logo

Comments (17)

pilhokim avatar pilhokim commented on August 27, 2024 3

You can directly bash into the postgres container and export the data out.

For instance,

$docker exec -i -t yourpostgrescontainerid bash

Then within Postgre bash, run pg_dumpall (or use pg_dump for selected db export).

root@yourpostgrescontainerid $pg_dumpall -U odoo | gzip -c > odoo_backup.out.gz
exit

Now copy out the backup file to your host
$docker cp yourpostgrescontainerid :/root/odoo_backup.out.gz yourbackupdirectory

After you would want to go back to Postgres bash and remove the backup file there.

from docker.

aetna-softwares avatar aetna-softwares commented on August 27, 2024

I had the same problem and it apears to be a version conflict between postgresql client in odoo and in postgresql server version.

If you get the version 9 of postgresql as described in the documentation, it will fetch you the version 9.5 but odoo image used version 9.4 which is not compatible.

you have to use version 9.4 of postgresql server image
(bad news is that your data created with 9.5 are not compatible with 9.4)

from docker.

eino-makitalo avatar eino-makitalo commented on August 27, 2024

Thx. Yes, I can backup using docker utils indeed. I also can backup when connecting to postgres docker instance through using database instance private address ...docker inspect db | grep "IPAddress" and connecting to port 5432 using pg_dump or pg_admin, but it seems that Odoo's own tool is not working. - So this is a bug report concerning faulty backup operation of Odoo when using this docker image.

from docker.

tkontogi avatar tkontogi commented on August 27, 2024

Not sure if my question relates to this bug.

What about backing up a DB from a hosted production odoo installation and restoring it into a local dockerized odoo?

Tried that with odoo 8 container, but it fails.

image

This is the error I get and immediately reverts to the main manager's page.

Any idea?

Appreciated.

from docker.

tkontogi avatar tkontogi commented on August 27, 2024

So packet loss is the root cause right? If the patch cords are loosing packets, then it is a no go for all the setup.

from docker.

helgetan avatar helgetan commented on August 27, 2024

i'm having the same issue, has anyone checked @aetna-softwares version conflict proposal?

from docker.

tkontogi avatar tkontogi commented on August 27, 2024

I tried to but I am always gettin the following error:

image

I am not sure if the error is related to our problem.

from docker.

tkontogi avatar tkontogi commented on August 27, 2024

OK... I have removed all images and start over again.. The import finished smoothly.
I am using odoo:8 and postgresql:9.4

One thing that does not work is the mapping of modules.

My images storage is '~/My-VMs/docker/'

In there I have '~/My-VMs/docker/maps/' for directories that will be mapped.

So I run

'docker run -v ~/My-Virtual-Machines/docker/maps/addons:/mnt/extra-addons -p 8069:8069 --name odoo --link db:db -t odoo:8'

But the modules are not accessible.

Then 'docker exec -it f76e52af0065 /bin/bash'

Then:
f76e52af0065:/$ ls -l /mnt/extra-addons/
ls: cannot open directory /mnt/extra-addons/: Permission denied
f76e52af0065:/$

Any ideas?

I used 'nsenter --target 5670 --mount --uts --net --ipc --pid' to change the ownership of /mnt/extra-addons in the image, but the results was the same.

So the solution regarding the images versions looks correct, but the mapping does not work for addons.

Open to any suggestions.

from docker.

tkontogi avatar tkontogi commented on August 27, 2024

AND IT WORKS

SElinux was the issue.

As of docker 1.7 there is a Z option following the mapping declaration, that automatically lables the hosts's to be mapped directory with the correct context for the container.

So.

To revise:

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db postgres:9.4

Observe the :9.4 (colon 9.4) at the end of the postgres image version.

docker run -v /full/path/to/hosts/dir:/mnt/extra-addons:Z -p 8069:8069 --name odoo --link db:db -t odoo:8

Observe the :Z (colon Z) at the end of the -v declaration.

In case you are using the image to experiment with you actual DBs backup, make sure that the host's path, has all the modules as in your production server.

I just restored into the docker image, my production DB running on a hosted server on the Internet.

Full functionality.

Regards,

Theo

from docker.

andersonkyle avatar andersonkyle commented on August 27, 2024

What is the recommended method for using the Odoo 9 Docker image with Postgres 9.5? The postgresql client included with the Odoo 9 image is for version 9.4 and doesn't support certain operations such as backup (e.g. pg_dump). How should we overcome this and bake it into a Dockerfile?

from docker.

andersonkyle avatar andersonkyle commented on August 27, 2024

@fpodoo Can you address my previous question?

from docker.

blaggacao avatar blaggacao commented on August 27, 2024

You need an manually updated odoo image, as it seems currently not covered by the odoo debian package, you could modify the apt-get install section and include postgres-client-9.5 , yet iirc it's not yet on the official apt repos, so you also need to include those repos first...

from docker.

elicoidal avatar elicoidal commented on August 27, 2024

this might help: odoo/odoo#12275 (comment)

from docker.

odony avatar odony commented on August 27, 2024

Bottom-line: please use the 9.4 version of the postgres docker image with Odoo 9. We're updating the docker image documentation to make the version tag explicit, so you'd run it this way:
$ docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db postgres:9.4

from docker.

odony avatar odony commented on August 27, 2024

@kanderson450 if you want to use PG 9.5 with the official Odoo 9 docker image you should simply add a layer on top of it to install the postgresql-client-9.5 package. You can get inspiration from the official postgres dockerfile, which is also based on debian:jessie, like the odoo one. Just install postgresql-client instead of the server.

from docker.

wredwan avatar wredwan commented on August 27, 2024

https://www.odoo.com/forum/help-1/question/backup-restore-fails-with-odoo-9-100788

from docker.

sylnsr avatar sylnsr commented on August 27, 2024

All you need to do is create your own image with the correct version of the client tools. For example, I am using PG 9.6 and solved it by simply adding this to my base image: https://github.com/idazco/odoo-docker-ez/blob/master/10/Dockerfile#L83

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.