Skip to main content

CLI tool to backup Confluence pages with images and attachments

Project description

DumpConfluence

A modern CLI tool to backup Confluence pages with images and attachments

Python Version License Tests

Fast, reliable, and user-friendly Confluence backup solution


✨ Features

  • 📥 Complete Page Backup - Download Confluence pages with all images and attachments
  • 💾 Self-Contained HTML - Generate beautiful, standalone HTML files with embedded CSS
  • 🔐 Secure Profile Management - Store and manage multiple credential profiles safely
  • 📦 Batch Processing - Backup multiple pages from URL lists efficiently
  • 🎨 Beautiful CLI Interface - Rich terminal UI with progress indicators and colored output
  • 📁 Smart Directory Management - Flexible output directory options with auto-creation
  • 🚀 Auto-Profile Selection - Intelligent credential selection for seamless workflows
  • 🛡️ Robust Error Handling - Comprehensive validation and helpful error messages
  • 🌍 Cross-Platform - Works on Windows, macOS, and Linux
  • 🔧 Developer Friendly - Full type hints, comprehensive tests, and clean architecture

Installation

From Source

# Clone the repository
git clone https://github.com/danilipari/dumpconfluence.git
cd DumpConfluence

# Install in development mode
pip install -e .

Using pip (when published)

pip install dumpconfluence

Quick Start

Basic Usage

Backup a single Confluence page:

dumpconfluence backup "https://company.atlassian.net/wiki/spaces/SPACE/pages/123456/Page+Title"

You'll be prompted for:

Save Credentials as Profile

Save your credentials for future use:

dumpconfluence backup "URL" --save-profile work

Use saved profile:

dumpconfluence backup "URL" --profile work

Specify Output Directory

By default, pages are saved in the current directory. To specify a different location:

dumpconfluence backup "URL" --output-dir /path/to/backups

Advanced Usage

Profile Management

Create a new profile:

dumpconfluence config add myprofile

List all profiles:

dumpconfluence config list

Remove a profile:

dumpconfluence config remove myprofile

Batch Processing

Create a text file with URLs (one per line):

https://company.atlassian.net/wiki/spaces/SPACE/pages/111/Page1
https://company.atlassian.net/wiki/spaces/SPACE/pages/222/Page2
https://company.atlassian.net/wiki/spaces/SPACE/pages/333/Page3

Process all URLs:

dumpconfluence batch urls.txt --profile work

Command Line Options

dumpconfluence backup [OPTIONS] PAGE_URL

Options:
  -u, --url TEXT        Confluence base URL
  -e, --email TEXT      Confluence account email
  -t, --token TEXT      Confluence API token
  -o, --output-dir TEXT Output directory (default: current)
  -p, --profile TEXT    Use saved profile
  --save-profile TEXT   Save credentials as profile
  --help               Show this message and exit

Getting an API Token

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click "Create API token"
  3. Give it a descriptive name
  4. Copy the token immediately (you won't see it again)

Output Structure

Each page creates its own directory:

Page_Title/
├── Page_Title.html    # Self-contained HTML with embedded CSS
├── metadata.json      # Page metadata and export info
└── images/           # Downloaded images
    ├── image1.png
    ├── image2.jpg
    └── ...

Configuration

Profiles are stored in:

  • Linux/Mac: ~/.config/dumpconfluence/config.json
  • Windows: %APPDATA%\dumpconfluence\config.json

⚠️ Security Note: Credentials are stored in plain text. Ensure proper file permissions.

Requirements

  • Python 3.8+
  • Confluence Cloud account with API access
  • Read permissions for target pages

Troubleshooting

Authentication Failed

  • Verify your API token is correct
  • Ensure your email matches the Confluence account
  • Check you have read permissions for the page

Images Not Downloading

  • Some images may require special permissions
  • Check if images are from external sources
  • Verify API token has proper scope

Page Not Found

  • Verify the URL is correct
  • Ensure you have access to the page
  • Check if the page exists in the specified space

Development

Setup Development Environment

# Clone repo
git clone https://github.com/danilipari/dumpconfluence.git
cd DumpConfluence

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode with extras
pip install -e ".[dev]"

Run Tests

pytest tests/

Code Formatting

black dumpconfluence/
ruff check dumpconfluence/

License

MIT License - See LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and questions, please use the GitHub Issues page.

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

dumpconfluence-1.0.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

dumpconfluence-1.0.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file dumpconfluence-1.0.0.tar.gz.

File metadata

  • Download URL: dumpconfluence-1.0.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dumpconfluence-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a08ebef5e083f3057c58f20ef81e572a9fece8e826a46d4c5a473773cd353020
MD5 4696dd73861dd7c70753c1d51af9c5ff
BLAKE2b-256 6f82194aefb9e50312bca05853b8668243ae77bfa8e3fce57081602b37da491a

See more details on using hashes here.

File details

Details for the file dumpconfluence-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dumpconfluence-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dumpconfluence-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db1aafc047e03ef12a061052e9ec33475f858141728b04e2842faec538257f5a
MD5 defa44debc11103ccdeeb0fe3ce36542
BLAKE2b-256 2e5659fe1f30d3d3bc32884506452448292dc5bca2cc23f99680f1ce9cac6ce0

See more details on using hashes here.

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