Forum Discussion
Putting back a template fails because {listid:Project Team} token not found in token list.
Hi any help is greatly apprecaited, I am struggling with what I thought were simple operations. Save off PNP xml from site collection A, manually via UI create site collection B using STS template, then apply template A onto Site collection B.
I'm using the feburary 2/10/2017 PNP remoting code to pull an xml (that works fine now) from a site collection that we have. This site collection includes a few lists and some fields. Saving off the template puts token's in the xml for later replacement E.g. "{listid:Project Team}". When I run the
ApplyProvisioningTemplate, it creates a list of all the tokens from the destination site B and replaces token's in the template xml (via ParseString in TokenParser.cs) with tokens from the destination site B which doesn't have all the lists created yet so it throws an exception saying that it's invalid XML because it still has the tokens. I must fundamentally be missing something given I thought the whole purpose of the template was to recreate an A like site on B. When I create the list Project Team manually on site collection B and run ApplyProvisioningTemplate it is able to find the token and continue on. Seems like creating the skeleton List first is necessary so that the token list can have the new content from A. The handler that creates the Lists isn't run until after Field processing.
Help!!! :)