Absolute path issue in layer (.lyrx) file connecting to .SQLite data

1425
6
Jump to solution
02-11-2022 06:57 AM
ASw93
by
Occasional Contributor

I have a very simple directory setup as follows:

  • Map\
    • Data\
      •  MappingData.sqlite
    • LayerFile.lyrx
    • Project.aprx

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?

0 Kudos
1 Solution

Accepted Solutions
ASw93
by
Occasional Contributor

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.

View solution in original post

0 Kudos
6 Replies
Robert_LeClair
Esri Notable Contributor

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.

0 Kudos
ASw93
by
Occasional Contributor

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.

0 Kudos
ASw93
by
Occasional Contributor

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.

0 Kudos
Robert_LeClair
Esri Notable Contributor

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.

0 Kudos
ASw93
by
Occasional Contributor

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.

0 Kudos
ASw93
by
Occasional Contributor

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.

0 Kudos