Odoo Help


Attachment on external disk

Hans Wiriya
on 8/27/14, 12:43 AM 4,104 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 ?



Med Said BARA

--Med Said BARA--

| 5 5 7
--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




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

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



Ben Bernard

--Ben Bernard--

| 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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


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