odoo12数据库备份没有所有者? [英] odoo12 database backup no owner?

查看:191
本文介绍了odoo12数据库备份没有所有者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法备份odoo 12数据库,我使用Postgres 10和docker container.error:

I can't backup odoo 12 database, i use postgres 10 and docker containers.error:

Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpgoyjsd3i/dump.sql', 'odoo') error 1

推荐答案

如果您使用不同版本的Postgresql客户端(Odoo服务器上的版本)和服务器(数据库服务器上的版本),则会发生此错误.如果您使用的是Odoo官方" Docker映像或基于该映像的映像,例如veivaa/odoo映像,它基于debian:stretch版本,并且具有Postgresql版本9.6作为默认客户端.使用此设置,您将出现不匹配的情况:客户端v9.6连接到服务器v10.这将导致您得到错误.

This error occurs if you have a different version of Postgresql client (the version on Odoo server) and server (the version on your database server). If you are using the Odoo "official" Docker image or image based on that, e.g. veivaa/odoo image, it is based on debian:stretch version and it has Postgresql version 9.6 as default client. With this setup you will have a mismatch: client v9.6 connecting to server v10. It will result in the error you are getting.

要解决此问题,您必须在客户端和服务器上安装相同版本.您可以将Postgres服务器降级到9.6,或将Odoo Docker容器中的Postgres客户端升级到10.您可以通过手动升级客户端来进行测试. docker exec -ti -u 0 yourodoocontainername bash到Odoo容器并在Odoo容器内执行以下命令:

To solve this you have to install same version on client and server. You can either downgrade your Postgres server to 9.6, or upgrade Postgres client in your Odoo Docker container to 10. You can test this by doing the client upgrade manually. docker exec -ti -u 0 yourodoocontainername bash to the Odoo container and executing these commands inside the Odoo container:

apt-get update
echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >  /etc/apt/sources.list.d/pgdg.list
yes Y | apt-get install wget
yes Y | apt-get install gnupg
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
yes Y | apt-get install postgresql-client-10

您需要在容器中具有root权限才能运行这些权限.安装完成后,您可以退出exec并使用docker restart yourodoocontainername重新启动容器.确保您拥有用于Odoo数据的永久存储,以免丢失文件存储.完成这些步骤后,您便可以使用Odoo Web界面进行备份和还原.

You need to have root permissions in the container to run these. After this install you can exit from exec and restart your container with docker restart yourodoocontainername. Make sure you have persistent storage used for Odoo data so that you don't lose your filestore. After these steps you are able to do backups and restores with Odoo web interface.

您可以使用psql --version命令检查您的Postgresql客户端版本.版本9.6的预期结果是psql (PostgreSQL) 9.6.10,版本10的预期结果是psql (PostgreSQL) 10.6 (Debian 10.6-1.pgdg90+1).

You can check your Postgresql client version with psql --version command. The expected result with version 9.6 is psql (PostgreSQL) 9.6.10 and with version 10 psql (PostgreSQL) 10.6 (Debian 10.6-1.pgdg90+1).

exec方法适用于测试,但不适用于永久使用,因为它涉及手动步骤.您应该通过修改Dockerfile来使用正确的版本构建Docker映像.

The exec method is good for testing but not good for permanent use because it involves manual steps. You should build your Docker images with the right version by modifying your Dockerfile.

这篇关于odoo12数据库备份没有所有者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆