Skip to content

[Feature]: Import support for Telegram Desktop chat exports (+media folders) #81

@advokatb

Description

@advokatb

Feature Category

Export/Import

Problem Statement

I'm always frustrated when I have a large archive of a specific chat already exported from the official Telegram Desktop app (in HTML format + folders with media), but I cannot load/view this history inside Telegram-Archive.
Right now Telegram-Archive is great for live incremental backups, but it doesn't allow importing historical data that users already saved via Telegram's built-in export feature. This forces people to either:

keep two separate viewers/archives, or
lose access to nice Telegram-Archive web interface for old chats.

Many users (including me) have years of important chats exported as backup and would love to unify everything in one beautiful local viewer.

Proposed Solution

Add support for importing Telegram Desktop export format into Telegram-Archive database/viewer.
Ideal implementation could look like this:

New CLI command, e.g.:
telegram-archive import --path /path/to/exported_chat_folder --chat-id 123456789

The importer should:

  • read result.json (Telegram's official export schema)
  • parse messages, dates, senders, replies, media types
  • import text messages, photos, videos, documents, voice messages, etc.
  • copy/move/link media files into Telegram-Archive media storage (with deduplication if possible)
  • correctly handle forwarded messages, service messages, pinned, edited messages if the fields are present

Optional flags:
--dry-run — show what would be imported without writing
--skip-media — import only text/metadata
--merge — try to add messages to an existing chat (by id or username)

After import the chat should appear in the web viewer just like normally backed-up chats.

Even partial support (e.g. only text + photos at first) would already be very useful.
Thanks for considering!

Alternatives Considered

No response

Additional Context

No response

Contribution

  • I would be willing to help implement this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions