Skip to main content

Couchbase Migration module

Project description

README

Code Description

This codeblock contains a Python script that performs data migration between two Couchbase clusters using the XDCR (Cross Datacenter Replication) feature. The script checks the cluster versions, verifies the existence of XDCR references, filters migratable buckets, starts the migration process, and prints the results.

Prerequisites

To run this code, you need to have the following dependencies installed:

  • requests: You can install it by running pip install requests.
  • time: It is a built-in Python module and does not require separate installation.
  • tabulate: You can install it by running pip install tabulate.

Make sure you have the necessary access rights and credentials to interact with the Couchbase clusters.

Running the Code

To use this code, you need to create an instance of the transportcb class, providing the required parameters:

  • sourceip: IP address of the source cluster.
  • destip: IP address of the destination cluster.
  • user: Username for authentication.
  • password: Password for authentication.

After creating the instance, the script will automatically execute the necessary steps for data migration, including checking cluster versions, XDCR reference existence, filtering migratable buckets, starting the migration, and printing the results.

[INFO] : Checking cluster versions.
[INFO] : No XDCR reference found. Program will create one.
[INFO] : All conditions are met. Program will create XDCR reference and create replication for each bucket.
[INFO] : Created XDCR Reference.
[INFO]: beer-sample Created.
[INFO] : Added reference for bucket beer-sample
+------------------------------------------------------+----------+----------------------------------------------------------------------------+
| Issue                                                | Result   | Recommendation                                                             |
+======================================================+==========+============================================================================+
| Version Control Check Between Source and Destination | ✓        | Destination cluster version can not be smaller than source cluster version |
+------------------------------------------------------+----------+----------------------------------------------------------------------------+
| XDCR Reference Check                                 | ✓        | Program is assuming there is no XDCR reference for the new destination.    |
+------------------------------------------------------+----------+----------------------------------------------------------------------------+
| Create XDCR Reference                                | ✓        | Reference for XDCR created.                                                |
+------------------------------------------------------+----------+----------------------------------------------------------------------------+

Output

The script will print the following information:

  • Cluster version check result: Indicates whether the destination cluster's version is equal to or greater than the source cluster's version.
  • XDCR reference check result: Indicates whether an existing XDCR reference is assumed for the new destination cluster.
  • XDCR reference creation result: Indicates whether the script created a new XDCR reference.
  • Recommendation: Provides recommendations based on the results of the checks.

The results will be displayed in a tabulated format.

Note: The codeblock assumes that the necessary imports and dependencies are already installed or available in the Python environment.

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

transportchb-0.0.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

transportchb-0.0.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file transportchb-0.0.1.tar.gz.

File metadata

  • Download URL: transportchb-0.0.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for transportchb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7cc74b949fb843c706bc9354210f78630086dc046a2a87832e55bdceef9f4f35
MD5 f35698e4aaf562e4266160d6b268aeaa
BLAKE2b-256 0a5dac6ac7ed63e6cef463c5066ca658ad8653fbcc06fcbe34b5699be7d50c93

See more details on using hashes here.

File details

Details for the file transportchb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: transportchb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for transportchb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e020c873e4020f6a0739a7f83dddfd3a8fb30b0bae50f7880a6d2ceda617fb5
MD5 80f2f339baf2ca668712777484cfd139
BLAKE2b-256 e5049ae9e8472f97e945b8ad935426c374638e81139381380b6d38076a21b151

See more details on using hashes here.

Supported by

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