Metadata-Version: 2.4
Name: fusion-datasource-cloner
Version: 0.1.0
Summary: CLI app to clone Lucidworks Fusion datasources and linked configuration objects
Author: Michael Sanchez
License: MIT
Keywords: lucidworks,fusion,cli,datasource,search
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0

# fusion-datasource-cloner

A real Python CLI that clones a Lucidworks Fusion datasource in the same Fusion instance and also copies the linked configuration objects it references.

What it clones:
- datasource configuration
- linked index pipeline
- linked query pipeline
- linked index profile
- scheduler entries that reference the datasource
- optionally the parser

What it does **not** clone by default:
- collections and indexed data
- connector binaries / plugin jars
- blob contents referenced by custom stages

## Install

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

## Run

Basic auth:

```bash
python3 -m fusion_ds_clone.cli \
  --fusion-url https://fusion.example.com \
  --app demo \
  --basic-auth admin:password \
  --source-datasource products-json \
  --target-datasource products-json-copy \
  --verbose
```

API key:

```bash
python3 -m fusion_ds_clone.cli \
  --fusion-url https://fusion.example.com \
  --app demo \
  --api-key 'Bearer eyJhbGciOi...' \
  --source-datasource products-json \
  --target-datasource products-json-copy
```

Dry run:

```bash
python3 -m fusion_ds_clone.cli \
  --fusion-url https://fusion.example.com \
  --app demo \
  --basic-auth admin:password \
  --source-datasource products-json \
  --target-datasource products-json-copy \
  --dry-run
```

Clone and also move the clone to a different collection reference:

```bash
python3 -m fusion_ds_clone.cli \
  --fusion-url https://fusion.example.com \
  --app demo \
  --basic-auth admin:password \
  --source-datasource products-json \
  --target-datasource products-json-copy \
  --collection products_copy
```

Clone parser too:

```bash
python3 -m fusion_ds_clone.cli \
  --fusion-url https://fusion.example.com \
  --app demo \
  --basic-auth admin:password \
  --source-datasource products-json \
  --target-datasource products-json-copy \
  --clone-parser
```

Replace already-existing target objects:

```bash
python3 -m fusion_ds_clone.cli \
  --fusion-url https://fusion.example.com \
  --app demo \
  --basic-auth admin:password \
  --source-datasource products-json \
  --target-datasource products-json-copy \
  --overwrite
```

## Notes

The tool derives new linked object IDs from the target datasource ID. Example:

- source datasource: `my-source`
- source index pipeline: `my-source`
- target datasource: `my-source-copy`
- target index pipeline: `my-source-copy`

If a linked object ID does not start with the source datasource ID, the tool creates a stable derived ID by suffixing the target datasource ID, for example:

- source query pipeline: `shared-catalog-qp`
- target query pipeline: `shared-catalog-qp-my-source-copy`

The parser API is still supported by the tool, but it is disabled by default because the current Lucidworks docs label parts of parser CRUD as deprecated.
