-
-
Notifications
You must be signed in to change notification settings - Fork 210
[16.0][ADD] dms_import: Migration data from documents EE to dms CE #409
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
base: 16.0
Are you sure you want to change the base?
Conversation
|
could you write desctiption on how to use it or configure if necessary, so that we could review easily? |
|
hi @kobros-tech you will receive an invitation to join the slack workspace where you'll find more information, see you there ;-) |
|
@nilshamerlinck |
kobros-tech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement Review Only, would recommend adding test cases
|
what can happen if there is a file that should be for a specific partner, shall we get the same file accessible by the same partner Only after migration? |
|
all right I will ping other mind to tell about real life scenario and then we can apply |
Sorry for my omission, I'd like to clarify some points:
|
|
yes, it is much better. once you are done you can ask me to review, good luck! |
d91427c to
1650324
Compare
de8ccd8 to
d98f346
Compare
9844447 to
e06570c
Compare
|
nice to have |
564fae4 to
0c05e18
Compare
578bb77 to
2cdf519
Compare
[IMP] dms_import: move pre_init_hook to post_init_hook [REF][FIX] dms_import: Use new syntax, avoid sql injection and fix group creation bug dms_import: also migrate achived data [REF] dms_import: avoid duplication by forcing tags, categories, and default group permissions [IMP] dms_import: improve performance, reduce batch size, and bypass heavy compute fields [FIX] dms_import: handle duplicate name [FIX] dms_import: standardize file names [IMP] dms_import: improve unique_name_new to avoid long name [FIX] dms_import: avoid check size when uploading files
2cdf519 to
ac5514c
Compare
Purpose
This migration script allows moving data from Enterprise
documents*(EE) to the OCAdms*(CE) modules.The goal is to preserve:
Approach
The migration is implemented as a
post-init hookand works directly at the SQL level to avoid dependencies on EE models. This ensures:The migration flow has three steps:
1. Tags migration
documents.facet→dms.categorydocuments.tag→dms.tag2. Folders migration
documents.folder→dms.directorydms.storage.documents_folder_res_groups_rel→dms.access.group(Write groups)documents_folder_read_groups_rel→dms.access.group(Read groups)3. Files migration
documents.document(binary only) →dms.fileir.attachment.res_model/res_idto the newdms.file.Data Mapping Details
documents.facetdms.categorydocuments.tagdms.tagdocuments.folderdms.directorydocuments_folder_res_groups_reldms.access.groupdocuments_folder_read_groups_reldms.access.groupdocuments.document (binary)dms.filedocuments_document_tag_reldms_file_tag_relir.attachment(linked to document)ir.attachment(relinked)dms.fileExtra Notes
Colors default to
randint(1, 11)when no valid sequence color is available.A default database storage (
dms.storage) is created if none exists.Logging is verbose:
Errors are logged per record without blocking the migration.
In the context of
documents.documentstored content via attachments (ir.attachment):With
dms.storageusingsave_type="database"(the default), the content will be recalculated and stored indms.file. This can put additional load on the database.With
save_type="attachment", the storage requires directories that act as references, including theres_modeland res_id of the record. Files within these directories will be linked to these values. For example, if the Contact directory references theres.partnermodel, it will create a directory named Admin storingres_model="res.partner"andres_id="3". Files attached to this partner will then be stored in the corresponding Admin directory. So if we choose to reference an existing attachment, it will require generating multiple directories corresponding to each attachment.Given the options, I chose
save_type="filestore", even though there is limited documentation about this type. In the current context, however, it seems to be the most appropriate choice.Example Workflow
dms.categoryanddms.tag.Validation
documents_*) exist and contain data.Migration should complete successfully and log a summary: