@Prashanth96,
One way is by using the AEM groovy console to find all those pages, and update the sling:resourceType, cq:template, you can create a migration script. https://github.com/icfnext/aem-groovy-console
The migration script would look something like this:
// example of finding all nodes with the sling:resourceType == 'my-site/components/structure/page';
def doMigration() {
def queryManager = session.workspace.queryManager
def statement = "/jcr:root/content/my-site//*[@sling:resourceType='my-site/components/structure/page']"
def query = queryManager.createQuery(statement, "xpath");
def result = query.execute();
def foundNodesInRows = result.rows;
// applying write method to each node.
foundNodesInRows.each { row ->
def pageNode = getNode(row.path)
pageNode.set("sling:resourceType", "my-site/components/structure/page2")
pageNode.set("cq:template", "/conf/my-site/settings/wcm/templates/page2")
// some kind of move operation...
println "Updated sling:resourceType * cq:template on ${row.path}"
}
}
doMigration()
session.save()
While creating the migration script, you should pull down content that is similar to production into your development environment, so you can test your script as you are building the script.
To take extra precautions, you should pull down the content into a lower environment, run the migration script, and then using a package manager to upload the code back to the production author... then replicate.