UmbracoContent AS uc ON uc.nodeId = umbracoNode.idĥ. When your select statement has the right list of documents you want to reassign, add in an update statement - this is the simplest code to read: UPDATE umbracoContent ON umbracoContent.nodeId = umbracoNode.idĪND (ntentTypeId = 1087) You can safely test you have the right documents by using this select statement - just update the magic numbers to suit your situation: SELECT * FROM umbracoNode Get in the database (I'm old school and use SQL Management Studio, but other IDEs are available) and find all the documents to migrate - for me it is all the content (of document type 1087) that are descendants of a given node - (in this case node id 4756). If you're confident, you can alter the properties of the new document type now - there is no magic in the reassignment step in the database.Ĥ. Note the id of the new document type: it's 5979 here. Don't forget to rename the document type alias by unlocking the padlock to keep your code tidy. Copy the document type, move it or rename it to suit your new structure. Once you're up and running with a local build, find the existing document type - note its numeric id from the URL in the browser. That way all of this can be done in safety.Ģ. First things first, get a local development environment - clone the source code (if you haven't already!) and download a recent bacpac of the database to work on. Let's talk Fluent Step by step instructionsġ. If you like what you've read so far, join us on LinkedIn to talk all things digital product development with our team of experts. Test, and deploy to cloud environments, rerunning the migration script.Use a database script to find all the content nodes I wanted to migrate, and reassign them from the old document type to the new one.Alter the new document type, leaving alone any properties containing content I wanted to keep.Copy the existing document type to a new version.Here's how I did it on an Umbraco Cloud project (version 8.14): The new page type would have some extra fields (sorry, properties) but most importantly I wanted to move all the content to a new microsite, which would use different page templates and have different permissions to enforce a new parent/child structure. I had a relatively simple use case involving an existing Umbraco Cloud site, where I wanted to migrate about 50 content nodes from a generic "page" type - containing quite involved Grid content - to a new, more specific type. It used to be possible to move between document types in Umbraco 7, but this Umbraco forum post and GitHub issue describe the problem developers face in Umbraco 8. One of the great things about Umbraco is its flexibility, but recently I hit a dead-end trying to refactor some existing content from one document type to another.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |