Umbraco is a powerful content management system that allows you to create custom document types with fields to match your specific needs. However, sometimes you may want to move fields from one contentType to another. Fortunately, this can be done easily using uSync, a package for Umbraco that allows you to export and import content and configurations.
In this tutorial, we'll walk through the steps to move document fields from one contentType to another using uSync.
Step 1: Install uSync
If you haven't already, you'll need to install the uSync package in your Umbraco instance. To do this, go to the Packages section in the Umbraco backoffice, search for uSync, and install it.
Step 2: Export the Source ContentType
The first step is to export the source ContentType that contains the fields you want to move. To do this, go to the Developer section in the Umbraco backoffice, select the uSync tab, and click the Export button. This will create a file with a .usync extension in the App_Data/uSync folder.
Step 3: Locate the Field(s) to Move
Next, open the exported .usync file in a text editor (such as Notepad or Visual Studio Code) and locate the field(s) you want to move. You'll see a section of XML code that defines the field(s).
Step 4: Copy the XML Code
Select and copy the XML code for the field(s) you want to move.
Step 5: Open the Destination ContentType's .usync File
Now, open the .usync file for the destination contentType that you want to move the field(s) to.
Step 6: Paste the XML Code
Locate the <GenericProperties> section in the destination contentType's .usync file and paste the XML code for the field(s) into it.
Step 7: Save the Destination ContentType's .usync File
Save the destination contentType's .usync file with the updated <GenericProperties> section.
Step 8: Import the Destination ContentType
Finally, go back to the Developer section in the Umbraco backoffice, select the uSync tab, and click the Import button. Select the updated .usync file for the destination contentType and import it.
That's it! The field(s) should now be moved from the source contentType to the destination contentType.
Moving document fields from one contentType to another in Umbraco using uSync is a straightforward process that can save you time and effort. By following these steps, you can easily move fields between contentTypes to meet your changing content needs.
We hope this tutorial has been helpful. If you have any questions or comments, feel free to reach out to us. Happy coding!