Move data from one SDE database to another with minimal downtime
Project description
swapper
This tool will
- 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
Setup
Production
git clone https://github.com/agrc/swapper
cd 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].
Development
- Clone project.
- Update
.env
file 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
Usage
CLI
Run swapper
for usage information.
From within other python code
from swapper import swapper
swapper.copy_and_replace('sgid.boundaries.counties')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ugrc-swapper-1.2.2.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for ugrc_swapper-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 611813e03409f5692150b891a4eb0018a011d764bf6a20edd6fd17279eb5ee7e |
|
MD5 | 387930547a43f803ff3d6bcb548e2704 |
|
BLAKE2b-256 | 256629dfd9f1058bc0b28127086b2a02dfde73f43b7b9b72e85284c53bb320bd |