Can someone show me how to change the name for a project file? For instance, I would like to change the name for "MyProject2" to something else, can I go the folder location where the .aprx file is stored, in this case is MyProject2 and change the name of the .aprx file to something else. I already have a DEM, shape files and raster datasets created under this project and am wondering if these files will be affected if I change the name of the .aprx file?
No not at all, you can rename that .aprx without breaking any links to your data. Obviously if you changed the name of the folder that the .aprx is in, that would then break the source links to the data in the .aprx (which isn't really a big deal anyway to fix for a small amount of layers).
to answer your question, yes just go to the folder location and change the name of the .aprx project file (perhaps try it out by making a copy of the folder first if you're unsure).
Stumbled across this while seeing if anyone has a new solution to renaming an old ArcGIS Pro Project. As a file system and data manager I'm not a fan of the Save->As method as it obfuscates the original windows file owner and version of the project. There has been an "under consideration" enhancement request for having ESRI write a tool to do this - see https://community.esri.com/t5/arcgis-pro-ideas/renaming-arcgis-pro-project-with-its-aprx-file/idi-p/...
The simple renaming of the .aprx file does essentially the same thing (I believe) as the builtin "Save As" while keeping file owner and file mod date the same.
However - and this is the tricky part - let's say you want to rename the Project and the associated Default Toolbox and Default Database that was created when the original project was created. The .aprx file is a ZIP archive with lots of serialized variables mostly stuffed into XML files. After renaming the .aprx - it still has has an internal GISPProject.xml file with references to <DefaultGeoDatabase> and <DefaultToolbox> which are set to the original name of the project. If these do not exist they will be created from scratch when opening the renamed project. This may be what is expected and not so expected in others - depends on what is required. Think of difference as having a mixed Toolbox or FGDB shared between the renamed project and the new project (The "Save As" or rename .aprx file method) or an archived Toolbox and FGDB representing the renamed name as a snapshot of the Toolbox and FGDB that existed at the time of Project rename. That will require some python or other code to manipulate the contents of the .aprx DocumentInfo xml - which can be accessed in ArcPy with the ArcGISProject class.