Skip to main content

Move data from one SDE database to another with minimal downtime

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

swapper

This tool will

  1. Take a sgid-internal feature class name (ie SGID.OWNER.FeatureClass) as input.
  2. Parse the name to get the corresponding connection files in L:\sgid_to_agol\ConnectionFilesSGID
  3. Check if the input sgid-internal connection file exists
  4. Check if the output sgid10 connection file exists
  5. Check if the sgid-internal input feature class exists
  6. Copy the feature class to sgid10 named fc_temp
  7. Run a function to delete the table locks on the old sgid10 feature class that's being replaced
  8. Delete the sgid10 feature class that's being replaced
  9. Rename the new copied feature class from fc_temp to fc
  10. Update the privileges for the agrc and SearchAPI users

Setup

Production

  1. git clone https://github.com/agrc/swapper
  2. cd swapper
  3. From within a virtual environment that has python 3.6+ and arcpy: pip install .\ -U
  4. Set SWAPPER_* environment variables as outlined in [.env.sample].

Development

  1. Clone project.
  2. Update .env file to be the correct path to the share folder.
  3. From within a virtual environment that has python 3.6+ and arcpy: pip install -e .[tests]
  4. swapper ...
  5. 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


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.3.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ugrc_swapper-1.2.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file ugrc-swapper-1.2.3.tar.gz.

File metadata

  • Download URL: ugrc-swapper-1.2.3.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ugrc-swapper-1.2.3.tar.gz
Algorithm Hash digest
SHA256 d7b53e2471945e95f11772cd621922b651b6e10b746f7634198949ae7588da54
MD5 02cf872d198f6b7e096395606a59e9a6
BLAKE2b-256 c275e32f0d4467a6ac8074a2e1a59a79d989bf96f3df51b93435fb7ae0c21cd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ugrc-swapper-1.2.3.tar.gz:

Publisher: push.yml on agrc/swapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ugrc_swapper-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: ugrc_swapper-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ugrc_swapper-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d36e947a9e3c2c8c1debce021db90b47d8e7e587ecdf43cfa83917073993dcb
MD5 0697518fd6aa9fbf830bde418027fd5e
BLAKE2b-256 dff39c8640ac685954f605292fa3c000311dfe81adbdcf403cf8c312160a377d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ugrc_swapper-1.2.3-py3-none-any.whl:

Publisher: push.yml on agrc/swapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page