⚡️ This tool can convert Telegram HTML backup to JSON, merge messages.json
files and import back.
Messages
Stickers: static and animated
Files
Video
Round Video Messages
Voice messages
Forwarded messages (partially supported)
Reply (partially supported)
Locations (partially supported via GoogleMaps)
Service messages: "Pinned message.." or "The topic has been changed.." (partially supported)
Calls (partially supported)
Contacts (partially supported)
Polls and votes (just as text)
Text formatting (Bold, Italic, etc.)
Message reactions (❤️👍 etc.)
Edited messages
Custom emoji or premium reactions
![]() Imported |
![]() Original |
Insert all scripts into the folder with your chat backup.
pip install beautifulsoup4 pillow mutagen tinytag moviepy
sender_map = {
"Test #1": "user111111111", - You
"Test #2": "user222222222" - Contact
}
To get the user_id, message the bot at UserInfoBot
python "FOLDER_WHERE_SCRIPT_IS\converter.py" --path "PATH_TO_BACKUP_FOLDER" --chat_id "CONTACT_ID"
If you received multiple messages.html
files instead of just one, you need to merge them.
FOLDER = pathlib.Path("YOUR_PATH")
python "FOLDER_WHERE_SCRIPT_IS\merge.py" --path "FOLDER_WITH_messages.html"
After the conversion is complete, rename the messages.json
file to result.json
.
If you combined files after conversion, the merged file does not need renaming.
Before importing a full backup, it's best to test everything on a small conversation._
pip install telethon tqdm python-dateutil
api_id, api_hash = ID, 'HASH'
To api_id
and api_hash
, log in to My Telegram website and create a test application.
python "FOLDER_WHERE_SCRIPT_IS\import.py" --path "FOLDER_WHERE_RESULT_IS\result.json" --peer "@USERNAME"
Then, you will go through the authentication process, including 2FA (if enabled). After that, the import begins.
Messages will appear in the chat after the last file is uploaded.