How to resolve datasource errors during Grafana dashboard provisioning?

I prepared a dashboard in Grafana in the browser. In its settings, in the JSON Model tab, I copied the entire code, then created a json file with this code and placed it in grafana/provisioning/dashboards. After doing docker compose up, the dashboard is created correctly, but when I open the dashboard, I get error "Templating
Failed to upgrade legacy queries Datasource “dashboad UID” was not found. Any ideas how to solve this?