This question has been flagged
2 Replies
4662 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 ...

Avatar
Discard

Upvoted, great question! :)

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.

Author

@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.

Author Best Answer

 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

Avatar
Discard