Splitting terraform template and tfstate

I had a terraform template to create multiple Azure mysql Database servers with azurerm_template_deployment, and all the database servers are running fine.

I am currently working on splitting the template so that one template is for one database server. I already finished splitting the template (so one azurerm_template_deployment is split to multiple azurerm_template_deployment) and its tfstate file, compared old and new templates, and made sure the new template is good. However, terraform shows that it will create new database resources instead of showing no diffs. After I proceeded the database creation , and it was actually creating a new deployment and updating the database. Since there was no change on the database configuration, no operation was applied to the database and the database did not go down.

Here is my question:
Why terraform shows that it will create new resources even if template and tfstate are split?

Hello!
The output from terraform plan shows you why terraform thinks it needs to create the resource, so it’s not possible to answer this without seeing that output. You also could compare the output from terraform plan and terraform state list. It might be something as simple as needing to run terraform state mv to match the existing resource to the resource terraform plans to create.