Changing the Class property from One Object type to new Object type

Hi there

I'm working on consolidating classes of various object types into a single Object Type. My primary challenge is migrating files and documents to a new class under this unified Object Type. Could someone advise on the different methods for changing the class from one object type to a new object type?

For example, we have multiple assets currently stored as separate Object Types. We aim to categorize all assets under a single Object Type called "Assets" and migrate all metadata and files into the new respective classes without manual entry. We also plan to eliminate the obsolete object types that won't be used going forward. What is the best approach to achieve this?

One option I’m considering is using replication. However, I'm unsure how to ensure that during import, the system selects the correct classes I want to add, rather than the original class from which the values were exported. I don't wish to delete the previous object types and classes until the transfer to the new class is complete.

Please share your thoughts and possible alternative solutions.

Thank you

Parents
  • There's a lot to consider here, both with the migration of the objects to the new object type (for instance how to update documents and other objects that have been referring to the old object types to point to the new objects) as well as the other vault configuration (for instance any object type specific auto-calculation rules and metadata card configurations would have to be updated as well).

    I recommend that you raise this with your M-Files reseller so you can review your current vault configuration and plan the change together. If you don't yet have a separate development / test vault, you should create a copy of the current vault so that you can test these changes in a sandbox environment first.

  • Thank you for your prompt response  

    I've reviewed all the vault configurations and noted everything that needs amending. However, my real challenge is copying all the metadata from one class to another within different object types in the same vault.

    I have a class called "Fleet" with an object type of "Fleet". Now, I want to move this "Fleet" class to a new object type called "Assets" within the same vault. I made a copy of the original "Fleet" class and changed the object type to "Assets". This created a similar class called "Fleet-1" under the "Assets" object type.

    I'm now trying to copy all the information from the current "Fleet" class to the newly created "Fleet-1". I used the Content Replication feature to export all existing data from the "Fleet" object type and destroyed the data after exporting. Once the export was completed, I swapped the aliases between the two classes to ensure the data would be imported into the "Fleet-1" class. However, this didn't happen; everything imported back into the same "Fleet" class from which the data was exported.

    Could you please advise if there is a way to modify the content package files (such as the index, content, etc.) to ensure the data is imported into the new class rather than the existing one? OR is there some other way of doing it that I am unaware of?

    Thank you

  • I don't really have any suggestions on how to best handle this change or if replication can be used, sorry. Some scripted solution may sometimes be required to update the existing references. Your reseller may have experience from similar cases so it's worth discussing this with them.

  • How many records does this "fleet" have ? 

    If everything else fails, you can create a view, get the limit of the view up to cover the amount of objects you have in that class (to not need to repeat the operation) and export it with files. This will create files and a CSV file with every objects metadata in an excel table.

    Then, you can use this CSV file to get everything back in to the class you choose using M-Files Importer.

    And finally, repeat the process for other objects as well. I suppose this should work. Let me know if I miss something

  • Hi Cag

    Thank you for your response.

    Yes, I believe that's the only way I can map the metadata to select the correct class.

    I have a quick question: is there a way to modify the Export Package created through the Content Replication and Archiving method? This would allow me to adjust the package and import the content as a separate class where I want to map.

    We don't want to lose the history of all those classes. Therefore, I'm looking for a solution to retain the records of all history and comments, and I believe Content Replication and Archiving is the only way to achieve this.

    Could you please share your thoughts on this?

    Cheers

Reply
  • Hi Cag

    Thank you for your response.

    Yes, I believe that's the only way I can map the metadata to select the correct class.

    I have a quick question: is there a way to modify the Export Package created through the Content Replication and Archiving method? This would allow me to adjust the package and import the content as a separate class where I want to map.

    We don't want to lose the history of all those classes. Therefore, I'm looking for a solution to retain the records of all history and comments, and I believe Content Replication and Archiving is the only way to achieve this.

    Could you please share your thoughts on this?

    Cheers

Children
  • First of all, I'm no official nor tried this before. So what I'm telling you is only based on my previous similar experiences. You should double check it with M-Files officials (support, dev team etc) before trying anything with live data..

    The xml you export should have content1.xml if you export actual files. Depending the amount of files you export,there might be more like Content2.xml, Content3.xml I'm not really sure.

    In those XML's, there are lines like the one below for every version of an object;

    <property datatype="Lookup" empty="false" id="100" name="Sınıf">Gelen Yazı<lookup deleted="false" 
    extidstatus="Internal" guid="{DE7286A3-4D5B-4B3F-8055-D945CEC88DAB}" id="16" otid="1" 
    otname="Sınıf" value="Gelen Yazı" version="-1" /></property>
    This information repeats for every version of an object as Class can be changed between versions.
    In theory, you can change the class with changing name, guid and id in those lines and then import to correct class... 
    However, I'd go wih Joonas's solution; Import it with wrong class and get someone write a VAF or script to update class in the new vault. If not many, you can mass select and change class from desktop UI.
    Again, I'd not try something like this in live data :) my thoughts on this is purely theory crafting..
    Edit : more complications; these changes will surely mess with indexes as well. It looks like modifying xml would cause more problems than fixing