Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attachment large object and ir attachment force storage version 10 very slow when reverting to filestore #1148

Open
gmathers opened this issue Nov 30, 2022 · 3 comments

Comments

@gmathers
Copy link

I am trying to revert the Odoo files from the PG large objects to the filestore. When i switch the location to "file", it looks as though the files will take weeks to convert for PG to filestore. Is there any way to speed this up? Our database is about 3 GB with the large objects included. Thanks!

@yelizariev
Copy link
Collaborator

Hello!

3 GB doesn't look as a big deal.
Do you make the migration on production or on a separate deployment?
You may try to add self.env.cr.commit() here, so the transaction data will not grow too much

for attach in self.search(domain):
# we add url because in some environment mimetype is not computed correctly
# see https://github.com/odoo/odoo/issues/11978
attach.write({"datas": attach.datas, "url": attach.url})

@gmathers
Copy link
Author

gmathers commented Dec 1, 2022

I have tried running the LO to file migration both on a staging deployment and on our production system - with similiar slow results. I have also tried running it with workers = 0 and with workers > 0 with no difference.
I tried adding the commit statement after line 79 "attach.write..." and the progress appears to be even slower.
Do you have any other suggestions? Thanks!

@yelizariev
Copy link
Collaborator

How many attachments you have? Maybe you should commit every 100 (or 1000) records?
I don't have other ideas. You may need to measure performance somehow for further analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants