Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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:
- Move the existing attachment to external disk. This is to reduce the size of our database which currently is about 30GB :(
- Save new attachment to external disk
Is it possible? Any helpful hints ?
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?
Last Step: deleting the oldest attacments from the DB?
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
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
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.
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 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/27/14, 12:43 AM|
|Seen: 3125 times|
|Last updated: 3/26/15, 2:37 AM|