Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Attachment on external disk

By
Hans Wiriya
on 8/27/14, 12:43 AM 2,895 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

1

Med Said BARA

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
Med Said BARA
On 8/27/14, 8:53 AM

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

 

 

 

0
George
On 3/26/15, 2:22 AM


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

0
Marek Mosiewicz
On 8/27/14, 6:03 AM

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

0

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 8/27/14, 1:32 AM

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.

 

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.

Hans Wiriya
on 8/27/14, 3:06 AM

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

Ben Bernard
on 8/27/14, 4:17 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 8/27/14, 12:43 AM
Seen: 2895 times
Last updated: 3/26/15, 2:37 AM