# Adobe Sign → DocuSign Migrator A Python toolkit for migrating library templates from Adobe Sign (Acrobat Sign) to DocuSign. It downloads templates via the Adobe Sign API, converts them to DocuSign format, and uploads them via the DocuSign API. --- ## What it does 1. **Authenticates** with Adobe Sign via OAuth (one-time browser flow, tokens saved to `.env`) 2. **Downloads** all visible library templates — PDF, metadata, and form field definitions 3. **Converts** each template to a DocuSign `envelopeTemplate` JSON, mapping all field types, coordinates, and recipient roles 4. **Uploads** the converted template to DocuSign --- ## Prerequisites - Python 3.10+ - Node.js 18+ (for the DocuSign upload CLI — uses the `esign-direct` package) - An Adobe Sign OAuth app (EU2 shard) with scopes: `library_read:self library_write:self user_read:self` - A DocuSign developer account with an integration key and RSA keypair --- ## Setup **1. Install Python dependencies:** ```bash pip install -r requirements.txt ``` **2. Create a `.env` file** in the project root (never commit this): ``` ADOBE_CLIENT_ID=your-adobe-client-id ADOBE_CLIENT_SECRET=your-adobe-client-secret ADOBE_REDIRECT_URI=https://localhost:8080/callback ADOBE_BASE_URL=https://api.eu2.adobesign.com/api/rest/v6/ DOCUSIGN_ACCOUNT_ID=your-docusign-account-id DOCUSIGN_INTEGRATION_KEY=your-integration-key DOCUSIGN_BASE_URL=https://demo.docusign.net/restapi DOCUSIGN_PRIVATE_KEY_PATH=/path/to/private.key DOCUSIGN_USER_ID=your-docusign-user-id ``` **3. Authenticate with Adobe Sign** (one-time): ```bash python3 src/auth_adobe.py ``` This opens a browser. After authorizing, paste the redirect URL back into the terminal. Tokens are saved to `.env` and auto-refreshed on subsequent runs. --- ## Running a migration **Download all templates from Adobe Sign:** ```bash python3 src/download_templates.py ``` Downloads to `downloads/__/` — one folder per template containing `metadata.json`, `form_fields.json`, `documents.json`, and the PDF. **Convert a downloaded template to DocuSign format:** ```bash python3 src/compose_docusign_template.py ``` Writes DocuSign template JSONs to `migration-output//docusign-template.json`. **Upload to DocuSign:** ```bash node packages/esign-direct/build/cli.js templates create --file migration-output//docusign-template.json ``` **Or run the full pipeline end-to-end for a specific template:** ```bash python3 src/migrate_paul_template.py ``` (Edit the `TEMPLATE_NAME` constant at the top of the script to target a different template. If multiple templates share the same name, the most recently modified one is used.) --- ## Field type mapping See [field-mapping.md](field-mapping.md) for the full Adobe Sign → DocuSign tab type table, including edge cases and known gaps. ## Known API quirks and bugs See [tests/PLATFORM-QUIRKS.md](tests/PLATFORM-QUIRKS.md) for documented platform bugs, unexpected API behaviors, and the fixes applied. --- ## Project structure ``` src/ auth_adobe.py # One-time OAuth flow for Adobe Sign adobe_api.py # Adobe Sign API client (auto token refresh) download_templates.py # Download all templates from Adobe Sign compose_docusign_template.py # Core conversion logic: Adobe → DocuSign JSON migrate_paul_template.py # End-to-end runner (download → convert → upload) downloads/ # Downloaded Adobe Sign templates (gitignored) migration-output/ # Converted DocuSign template JSONs (gitignored) field-mapping.md # Field type mapping table + edge case log tests/PLATFORM-QUIRKS.md # Known bugs and API quirks requirements.txt # Python dependencies ```