- Take a sgid-internal feature class name (ie SGID.OWNER.FeatureClass) as input.
- Parse the name to get the corresponding connection files in L:\sgid_to_agol\ConnectionFilesSGID
- Check if the input sgid-internal connection file exists
- Check if the output sgid10 connection file exists
- Check if the sgid-internal input feature class exists
- Copy the feature class to sgid10 named fc_temp
- Run a function to delete the table locks on the old sgid10 feature class that's being replaced
- Delete the sgid10 feature class that's being replaced
- Rename the new copied feature class from fc_temp to fc
- Update the privileges for the agrc and SearchAPI users
git clone https://github.com/agrc/swappercd swapper- From within a virtual environment that has python 3.6+ and arcpy:
pip install .\ -U - Set
SWAPPER_*environment variables as outlined in [.env.sample].
- Clone project.
- Update
.envfile to be the correct path to the share folder. - From within a virtual environment that has python 3.6+ and arcpy:
pip install -e .[tests] swapper ...pytest
Run swapper for usage information.
from swapper import swapper
swapper.copy_and_replace('sgid.boundaries.counties')