This question has been flagged
6 Replies
10213 Views

We having been working with openERP 6.1 for about a year now and somehow our database get bigger and bigger. We have a lot attachment to save in case we lost our hard copy, but now we need to move the attachment to external disk.

What we are trying to achieve are:

  1. Move the existing attachment to external disk. This is to reduce the size of our database which currently is about 30GB :(
  2. Save new attachment to external disk

Is it possible? Any helpful hints ?

Thx,
Hans

Avatar
Discard
Best Answer

As your database is growing more and more, the first thing to do is to move your storage location out of it (out of the database).

How to do  this? One of the Best Links

From now, your files (attachments, images, ....) will be stored on the file system @ ...../openerp_root_folder/filestore/your_database_name, this is just a first Step before moving them to an external Disk.

The question know is how to move the oldest attachments to this location, and after that, deleting them from the database to  reduce the size of your DB?

There is a module document_extract_from_database for V7.0, and for V8.0 but not yet usable, maybe you can use it for V6.1.

Last Step: deleting the oldest attacments from the DB?

Another link to read

 

 

 

Avatar
Discard
Best Answer

For moving attachment, I think it's doable via xml-rpc

  • model: ir.attachment
  • binary data usually encoded with base64
  • decode binary data and write as pdf file

But, I'm not sure about dependency with existing resources. Checking this dependency is usually a harder problem. After this problem resolved, you can clear the record from ir_attachment table.

 

Avatar
Discard
Author

thx Ben. What about setting for openerp not to store future binary on ir_attachment table? I can't find any setting unser Configuration menu. Again i m using v6.1.

Check SETTINGS -> Customization -> Low Level Objects -> Actions -> Report. In the list view check SAVE AS ATTACHMENT PREFIX, blank means no save to database.

Best Answer


Hi friends,

I am using windows server but i am not able to store file in my local hard drive.

My configuration file looks like this.

db_host = localhost

db_port = 5432

db_user = odoo

db_password = odoo

data_dir = D:\odoo_documents

addons_path = D:\Development\Workspace\odoo-8.0-20150317\openerp\addons

xmlrpc_port = 8069

netrpc_port = 8070

Please help me to store file in local

Avatar
Discard
Best Answer

Files are stored in place from config['data_dir']/filestore By default it points to Odoo system user (operating system user who runs odoo server) home directory and then filestore directory.

If home directory is not available for user it points to /usr/local/share/filestorage or /usr/share/filestorage. On windows it points to ProgramData folder probably. You can craete on linux symbolic link to this folder on new partition (and rememeber to copy all files there to new location) or change 'data_dir' config property adding --data-dir option to run odoo server

Marek Mosiewicz

http://consultantodoo.com

Avatar
Discard