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.

3

File storage on another DB

By
Jean-François
on 5/11/15, 9:04 AM 517 views

Hello guys,

I've recently migrated from v6.1 to v7 and decided to improve my OpenERP/Odoo setup.

As we know, having attachments/documents stored in main DB is being a real problem as the DB grows and grows, so the main idea is to use filestore to store documents on filesystem, yes it's a great idea...

But, what I would like to do, is to store all attachment in a database but not the "main" database, I would like to store them on another database. ( it's quite like having the ir_attachment on another DB).

Is it possible ? how ?

Thanks ;)


EDIT :

As an update, I'm migrating to Odoo 8 to be "up to date", but same question remains, that would be really great ...

Upvoted, great question! :)

Yenthe
on 5/11/15, 9:10 AM

Though this is very controversial question so I believe to add "comment" rather then "answer". First of all there is no sense to store attachments to another table yet at there you want to still let them store on database. Because when you will go to backup that "main" db, you will also need to backup of "filestore" db otherwise this is worthless to store. So again same problem will be there, 2nd "filestore" db will be too large. Still If you want to store them into another database then you need to just "Override/Hide" name_search, search, create, unlink & write method in "main" db and just change the cursor (cr) and call the API of that "filestore" db. Yet you need to store the credentials of "filestore" databast to somewhere in "main" database so at the time of calling API from "main" database those credentials will be useful for connection. By doing so, when you create any attachment at "main" db, it will create attachment in "filestore" db. Same thing will be applicable at write + unlink time.

Emipro Technologies Pvt. Ltd.
on 5/15/15, 9:03 AM

@Emipro : Thanks for your answer, but I wanted to reply to the "controversial"... What about replication / data consistency ect ? (I'm a Linux sysadmin, so it wont be difficult for me to setup workaround solution for theses points but it's a little more work). Also if I want to share some "filestore" data, it would be easier (safer?) if I have data stored in another DB. I'm also thinking about the module which allow to store product images in the filestore (I didn't find yet if in Odoo 8 product images are in filestore or in DB by default like previous versions), maybe interested in sharing those images using a "filestore" DB.

Jean-François
on 5/15/15, 11:45 AM
0
Jean-François
On 5/14/15, 11:44 AM

 EDIT :

Maybe there is a "solution" (not really what I wanted initially, but it's a great idea on how to store attachments data). I didn't tried it yet, I'm working on migrating my postgres server, the idea is to use postgres "Large Object".

I've found a post where someone has made a module for it :

https://anybox.fr/blog/postgresql-large-object-storage-for-odoo

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: 5/11/15, 9:04 AM
Seen: 517 times
Last updated: 5/15/15, 11:48 AM