I have a very simple directory setup as follows:
The layers in my LayerFile.lyrx are connecting to my Data Source MappingData.sqlite to display my features. This works absolutely fine.
However, I now want to easily transfer that setup to a new computer. If I copy the entire contents of the root Map folder and paste it onto another machine, the Data Sources within the layers are absolute paths referencing the full path from my previous computer. So if I open the Project.aprx project that has layers in it reference the SQLite data, they're all now unconnected.
I thought ArcGIS Pro layers automatically used relative paths to connect to data sources so you could move this setup between machines without having to reconnect layers. What am I doing wrong here? Is there a way I can force relative connectivity to the SQLite data within the Project file?
Solved! Go to Solution.
It looks like the answer to this is that no files allow relative paths when using a .sqlite database as it's data source. This is quite frustrating.
When you created your *.lyrx file (i.e. LayerFile.lyrx), did you use the Save to Layer File (Data Management) GP tool and check the "Checked" parameter for the Store Relative Path parameter? This may be the cause as by default the save as layer file will store an absolute path.
Thanks, this might solve it for the .lyrx file. What about the .aprx file? (I updated the post since your reply). Everything within this disconnects and not sure how I can force relative paths within this.
Just to come back to this, even when specifying the Store Relative Path parameter when saving layer files, this still stores the absolute path. I am wondering if a caveat to storing data in .sqlite databases is Arc treats them like a remote database connection on a server and so any layers connecting to them cannot be stored as a relative path. Rather frustrating if so.
There's quite a bit of information on a related forum topic here about what happens when you copy the *.aprx file vs copying the entire home folder and folder structure in Pro. An option I would consider is to create a project template to transfer your project from one computer to one (or more) computers. I would think this would resolve the broken data links.
Copying a project template along with the source data still includes absolute paths. The template is referring to where the source data used to exist.
It looks like the answer to this is that no files allow relative paths when using a .sqlite database as it's data source. This is quite frustrating.