This is a programme (transfer.py) I created for migrating entries from one sqlite datatbase to the null entries of another, in this case, telegram messages in the sqlite database created by telegram_backup. This is so that more entries can be added to the database without disrupting the backup process and allows for lost messages to be taken from a friends database and inserted into random empty messages (deleted messages), without causing issues. Media files will also be copied over from friend to home directory. If the home DB starts at 130k and your friend's goes from 0k-140k then some media files ID: 130k-140k will begin to clash and wont be copied over (because the message that was ID 140k on a friends account as 130k on your own). Seeing as the tool is mainly for my own situations, functionality will not be added in unless it is necessary for me. This tool will always be necessary even if telegram removes the message cap.
TxtToDatabase builds on this by allowing messages that have been salvaged by the chrome plugin telegram history grabber to also be entered in the database, because these messages are still visible to the client. It takes manually downloaded media files and the raw messages from the .txt file and inserts them into the database at the appropriate time and date so that they appear correctly in the hmtl chat export. This will no longer be required when telegram removes the ~1m message limit and the old messages come back from offline storage.
The code will be reused in the future to adept to future scenarios involving telegram backup, for instance transferring pre 1m update messages to from the new official backup to the old backup because the interface is better.