Both seems to be working when deployed along with the original. So how is these two are different? And whats the right approach?
The 'best' approach is to use the UI for the IDs to be regenerated. However, depending on your use case it may not really matter. The component IDs must only be unique to the page, so you're ok whether they're regenerated or not. The page ID should be unique to the branch, but you may never run into a case where that's a problem, especially if you don't use LSCS. If you're worried about it, just update the EA and the root node in the page XML with a new number after you've copied it with the CLT.
And is there anyway to achieve the UI copy thru command line or thru custom scripts or in workflow?
Hello, I might not be helping out with the reply, but looking at the question, I am wondering if "iwcp" is not doing what you want? or what problem you face with iwcp?Thanks in advance for clarification.-N.,/
Not exactly. To access the exact same call, you'd have to figure out the internal class doing the work and call it yourself, but accessing undocumented classes outside of the cssdk is obviously unsupported. You can give CSFile#copy() a try, but I don't know offhand whether that'll behave like the UI command or the CLT.