{"id":73,"date":"2020-06-09T15:20:02","date_gmt":"2020-06-09T13:20:02","guid":{"rendered":"http:\/\/disorder.dk\/wonderware\/?p=73"},"modified":"2022-05-27T13:07:52","modified_gmt":"2022-05-27T11:07:52","slug":"how-to-copy-a-template-or-contained-template","status":"publish","type":"post","link":"https:\/\/disorder.dk\/wonderware\/2020\/06\/09\/how-to-copy-a-template-or-contained-template\/","title":{"rendered":"How to Copy a Template or Contained Template"},"content":{"rendered":"\n<p>Building a new template or contained template from scratch can be very time consuming and risk of making a mistake in a script, missing function or graphics is just another factor against doing it manually.<\/p>\n\n\n\n<p>But there is no copy\/paste method for this. Galaxy dump only works for instances and all of a sudden it seems like you have to do it manually. But we have to think a little different, so see the possible solution, to make a copy of a existing template.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"><strong>If you have instances of your template, rename it before export, to the new template name you want and rename it back after the export.<\/strong><\/mark><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"314\" height=\"469\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_start.jpg\" alt=\"\" class=\"wp-image-74\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_start.jpg 314w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_start-201x300.jpg 201w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><figcaption>We want to copy the contained template &#8220;Type_01&#8221; of $Mixer to a new &#8220;Type_02&#8221;<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Export the template or contained template that you want to make a copy of.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"481\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_export.jpg\" alt=\"\" class=\"wp-image-75\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_export.jpg 558w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_export-300x259.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><figcaption>Export the template to copy<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Save it anywhere, it is not important to save for this demonstration. If you have a set of finalized templates in your engineering system, you could have them all exported as Type_00, so they were always ready to import to make a new type.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"473\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_save.jpg\" alt=\"\" class=\"wp-image-76\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_save.jpg 626w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_save-300x227.jpg 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><figcaption>Save the .aaPKG file<\/figcaption><\/figure>\n<\/div>\n\n\n<p>A list of all the exported objects is presented, it is important that you have all the child objects in a contained template selected as well, else you will only export the parent of the contained template.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"539\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_exportdone.jpg\" alt=\"\" class=\"wp-image-77\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_exportdone.jpg 490w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_exportdone-273x300.jpg 273w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><figcaption>Export successfully<\/figcaption><\/figure>\n<\/div>\n\n\n<p>If you did not rename the original template to start with, now is the time to rename the original to something else, to make it possible to import it again where it can only get its original name it was exported with. This is how you get a copy with a new name.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"567\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_rename.jpg\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_rename.jpg 441w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_rename-233x300.jpg 233w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><figcaption>Rename the original template.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The new copy Type_02 of the original Type_01 is now done, but Type_01 is missing until we import it again. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"314\" height=\"470\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_renamed.jpg\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_renamed.jpg 314w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_renamed-200x300.jpg 200w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><figcaption>New copy of the contained template.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Import objects to get the original Type_01 template back.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"429\" height=\"466\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_import.jpg\" alt=\"\" class=\"wp-image-80\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_import.jpg 429w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_import-276x300.jpg 276w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><figcaption>Import of old template.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Import preferences can be used as default.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"481\" height=\"439\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_importpreferences.jpg\" alt=\"\" class=\"wp-image-81\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_importpreferences.jpg 481w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_importpreferences-300x274.jpg 300w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><figcaption>Default import settings.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Import was successful with all objects imported. Some of the basic templates are skipped as there is no changes to them, they are merely the parents of the objects in the contained template. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"522\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_imported.jpg\" alt=\"\" class=\"wp-image-82\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_imported.jpg 550w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_imported-300x285.jpg 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><figcaption>Import completed.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Now we have two identical contained templates of Mixer and we can start making the required changed to Type_02 in order to make the changes needed for the new type, but still have the same functionality as Type_01, but without building it all from scratch.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"315\" height=\"537\" src=\"http:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_done.jpg\" alt=\"\" class=\"wp-image-83\" srcset=\"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_done.jpg 315w, https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_done-176x300.jpg 176w\" sizes=\"auto, (max-width: 315px) 100vw, 315px\" \/><figcaption>Two identical contained templates.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>If your original Type_01 contained template had instances, those are now referring to Type_02, so it is important to do a few steps differently if you have instances. Rename the original before export, to the new template name and rename the original back to its original name before import of the new template.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building a new template or contained template from scratch can be very time consuming and risk of making a mistake in a script, missing function or graphics is just another factor against doing it manually. But there is no copy\/paste method for this. Galaxy dump only works for instances and all of a sudden it<\/p>\n<p class=\"excert-link-wrapper\"><a href=\"https:\/\/disorder.dk\/wonderware\/2020\/06\/09\/how-to-copy-a-template-or-contained-template\/\" class=\"excerpt-more-link\" >Continue Reading<span class=\"screen-reader-text\"> &#8220;How to Copy a Template or Contained Template&#8221;<\/span><span class=\"meta-nav\"> &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":74,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,23],"tags":[27,28,29,8,30,3],"class_list":["post-73","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-archestra-ide","category-system-platform-2020","tag-contained","tag-copy","tag-export","tag-galaxy","tag-import","tag-templates"],"jetpack_featured_media_url":"https:\/\/disorder.dk\/wonderware\/wp-content\/uploads\/2020\/06\/systemplatform2020_templatecopy_start.jpg","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":3,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/posts\/73\/revisions\/288"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/media\/74"}],"wp:attachment":[{"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/disorder.dk\/wonderware\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}