With ArcPro 3.5, ESRI has cracked down on letting us define the projection on a feature class that has a projection. We have been importing an existing schema from an XML and then using Define Projection in a model to redefine the projection for the new project. In 3.5, this no longer works. We tried it in arcPy as well.
This seems like an unfortunate level of hand-holding. ESRI should trust users to know when it is appropriate to redefine a projection.
@AustinStreetman I am not in Version 3.5 yet, this doesn't seem like this is intentional. I would reach out to support about your issue. As long as the tool is in ArcGIS Pro you should still have the capability to change the projection.
I am not able to replicate this behavior in 3.5. Per the 3.5 documentation, it states: "when a dataset with a known coordinate system is input to this tool, the tool will issue a warning message but will run successfully."
I don't think Esri intentionally took away that functionality. I suspect it's just a bug. You'll probably have to reach out to support and see if they can reproduce the issue on their end.
Yes, but also states it won't work on a DS with an existing feature class.
If you compare the 3.5 to previous versions at
Define Projection (Data Management)—ArcGIS Pro | Documentation
you will notice that there are new restrictions. I can't tell from your code and the files whether this is what you are running up against. Have a look and compare to your previous version using the "Other versions" toggle
Comparing 3.5 to 3.4 in detail, I don't see any new restrictions, there's just more clarifications for why you can't run the tool on EGDB or Feature Dataset classes (as well as workarounds).
@AustinStreetman if you try to define projections for some troublesome data using just the tool interface (no arcpy) do you get a better error message?
I jumped from 3.1 to 3.5, it worked in 3.1 for sure. The new 3.5 version greatly reduces the usefulness of the tool. I had to run the same script on a machine that still has Arcmap in order to get it to work on existing data. Nothing short of a ridiculous change!
Certainly run the test in Pro GUI or get and print print the actual error. This could be many different things from switching versions.
We use the DefineProjection tool extensively in arcpy for a scripted process that we re-run during development and migration into ArcGIS Parcel Fabric. In prior versions (3.4 and earlier) there were no issues. We have Pro 3.5.0 and all of a sudden I am getting an error ("ERROR 000146: Cannot alter the spatial reference"), in both arcpy and Pro/UI Toolbox for Define Projection. I am trying to open an Esri case because this seems like a bug. I think it should still run with warning as it always has if there is already a projection defined. There is no way to set Unknown spatial reference, so what if you make a mistake, or are conveniently using it to set up a new gdb that does not have any data in it yet?
Unfortunately it's not a bug, but an intentional change like the original post indicates!