Possible to add fields to a document type, using a package?
For some weeks ago I made a site running Umbraco (surprise! :D ). I created the content, images, subpages etc. etc.
But now I have made som improvements, and developed some new features that I would like to deploy to the website. I made all the changes and improvements on my local machine, so I didn't destroy something on the working, "old" site. Actually the content of the "old" website is the newest and best, so the only thing I want to move is the new functionality.
When I say new functionality, I mean some new XSLT files, changes in some templates/CSS etc. This is easy to move in the file system so no problem there.
But it also means some extra new fields on some of the document types, new macros in Umbraco and other small things. Things that are stored in the database. So I am thinking of making some packages I can use to move the changes in the database, from my local development-site, to my already working site.
But what happens if I put a document type in a package, and installs that package on the site where the same document type already exists? Only difference is that there are some more fields on the newly packed doc type.
Will Umbraco automatically update the "old" doc type with the new fields or what will happen?
I know that I could just manually create the fields on the already existing doc type, but still I'm interested in knowing how Umbraco will behave in the above scenario?
We had the same dillema on our last Umbraco project. Here's what we found out with simple try-and-error: if there are new fields in the dtype, Umbraco will manage the additions fine, but if you remove fields, it won't remove the fields while installing.
In your case it is fine to create the package and to install it. Of course make full backup (filesystem and database) before doing that.
I have not removed any fields, so I could actually make a package with all of my document types and my new macros, and this would probably work without any errors - Even though theres always a small risk...
Provided that the aliases of the doc types are the same any missing properties will be added, and any matching properties will be updated (ie - changed description, regex or data type), again, matched on alias
Sorry for necropost, but it might be important. Umbraco v6.1.4 (Assembly version: 1.0.4958.23183)
"Provided that the aliases of the doc types are the same any missing properties will be added, and any matching properties will be updated (ie - changed description, regex or data type), again, matched on alias"
Witnessed behaviour: missing properties are added, any matching properies are unchanged. This means description, mandatory flag, field type. Didn't check validation.
For a test case I made both document type and package locally. Saved package to hdd, changed document type then installed package as local one.
Possible to add fields to a document type, using a package?
For some weeks ago I made a site running Umbraco (surprise! :D ). I created the content, images, subpages etc. etc.
But now I have made som improvements, and developed some new features that I would like to deploy to the website. I made all the changes and improvements on my local machine, so I didn't destroy something on the working, "old" site. Actually the content of the "old" website is the newest and best, so the only thing I want to move is the new functionality.
When I say new functionality, I mean some new XSLT files, changes in some templates/CSS etc. This is easy to move in the file system so no problem there.
But it also means some extra new fields on some of the document types, new macros in Umbraco and other small things. Things that are stored in the database. So I am thinking of making some packages I can use to move the changes in the database, from my local development-site, to my already working site.
But what happens if I put a document type in a package, and installs that package on the site where the same document type already exists? Only difference is that there are some more fields on the newly packed doc type.
Will Umbraco automatically update the "old" doc type with the new fields or what will happen?
I know that I could just manually create the fields on the already existing doc type, but still I'm interested in knowing how Umbraco will behave in the above scenario?
Hi Kim,
We had the same dillema on our last Umbraco project. Here's what we found out with simple try-and-error: if there are new fields in the dtype, Umbraco will manage the additions fine, but if you remove fields, it won't remove the fields while installing.
In your case it is fine to create the package and to install it. Of course make full backup (filesystem and database) before doing that.
Regards,
Vanja
Okay, that sounds great Vanja.
I have not removed any fields, so I could actually make a package with all of my document types and my new macros, and this would probably work without any errors - Even though theres always a small risk...
Provided that the aliases of the doc types are the same any missing properties will be added, and any matching properties will be updated (ie - changed description, regex or data type), again, matched on alias
Thanks for the answer as well slace. I'll try it out tomorrow (it's almost midnight here in Denmark now :) )
Thanks Slace and Vanja.
This worked just like it was intended. I tried out the same with my macros, but this resulted in double macro's :P
But both of your answers where great. If I could I would mark both of them as the correct answer :)
Sorry for necropost, but it might be important. Umbraco v6.1.4 (Assembly version: 1.0.4958.23183)
"Provided that the aliases of the doc types are the same any missing properties will be added, and any matching properties will be updated (ie - changed description, regex or data type), again, matched on alias"
Witnessed behaviour: missing properties are added, any matching properies are unchanged. This means description, mandatory flag, field type. Didn't check validation.
For a test case I made both document type and package locally. Saved package to hdd, changed document type then installed package as local one.
is working on a reply...