Openerp Odoo数据库备份错误
我想将Odoo应用程序从开发转移到生产系统。为此,我想对我的数据库进行备份,我正在从UI进行备份。 在进行备份时,这是UI上显示的错误 数据库备份错误:“非类型”对象没有属性“\uuu getitem\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu”Openerp Odoo数据库备份错误,openerp,database-backups,Openerp,Database Backups,我想将Odoo应用程序从开发转移到生产系统。为此,我想对我的数据库进行备份,我正在从UI进行备份。 在进行备份时,这是UI上显示的错误 数据库备份错误:“非类型”对象没有属性“\uuu getitem\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu” 2016-03-19 06:00:02,351 2864 ERROR ? openerp.addons.web.controllers.main: Database.backup Traceback (most recen
2016-03-19 06:00:02,351 2864 ERROR ? openerp.addons.web.controllers.main: Database.backup
Traceback (most recent call last):
File "C:\Odoo 9.0-20160127\server\openerp\addons\web\controllers\main.py", line 693, in backup
File "C:\Odoo 9.0-20160127\server\openerp\addons\web\controllers\main.py", line 422, in content_disposition
TypeError: 'NoneType' object has no attribute '__getitem__'
2016-03-19 06:00:02,413 2864 INFO ? werkzeug: 127.0.0.1 - - [19/Mar/2016 06:00:02] "POST /web/database/backup HTTP/1.1" 200 -
您应该首先以管理员身份登录数据库,然后返回备份数据库 问候,,
FTK只要访问任何数据库登录屏幕,然后返回将正常工作的备份即可。在备份后使用的任何登录屏幕中设置其他cookie 如果您使用curl实现了一些自动化,那么您需要curl到/web?db={database name},这将使您重定向到具有db set的登录页面,然后使用与保存的cookie相同的curl会话将curl post发送到/web/数据库/备份。php中的类似内容:
$cookie_file = dirname(__FILE__) . "/" . date('Y-m-dH:i:s') . '.txt';
$ch = curl_init($odooHost . "/web?db={$databaseName}");
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
$content = curl_exec($ch);
if(curl_errno($ch)) {
echo 'error:' . curl_error($ch);
curl_close($ch);
unlink($cookie_file);
return;
} else {
curl_setopt($ch, CURLOPT_URL, $odooHost . "/web/database/backup");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"master_pwd={$password}&name={$databaseName}&backup_format=zip");
$content = curl_exec($ch);
在此之后,在$content中,您应该拥有备份的数据库。保存到文件或任何你需要的