-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database backup #49
Comments
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 |
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 Now copy out the backup file to your host After you would want to go back to Postgres bash and remove the backup file there. |
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. |
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. This is the error I get and immediately reverts to the main manager's page. Any idea? Appreciated. |
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. |
i'm having the same issue, has anyone checked @aetna-softwares version conflict proposal? |
OK... I have removed all images and start over again.. The import finished smoothly. 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: 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. |
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:
Observe the :9.4 (colon 9.4) at the end of the postgres image version.
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 |
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? |
@fpodoo Can you address my previous question? |
You need an manually updated odoo image, as it seems currently not covered by the odoo debian package, you could modify the |
this might help: odoo/odoo#12275 (comment) |
The odoo docker image is based on debian:jessie, which only has postgresql-client-9.4, while the official postgres docker is 9.5. This causes a version mismatch and errors when using the postgres command-line tools, such as `pg_dump`. Fixes odoo/odoo#12275 Fixes odoo/docker#49 Fixes odoo/docker#54 Fixes odoo/docker#59
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: |
@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. |
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 |
When using login page database backup you get error...
Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpFL6pNy/dump.sql', u'mydbname') error 1
The text was updated successfully, but these errors were encountered: