bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
755 stars 36 forks source link

currently unsupported database version (79) #217

Closed drzraf closed 2 months ago

drzraf commented 2 months ago

Sorry for bringing up an edge-case, but

signalbackup-tools signal.backup --exporttxt exports-2020-11 --migratedb

BACKUPFILE VERSION: 0
BACKUPFILE SIZE: 158213098
COUNTER: 2780193757
Reading backup file: 100.0%...
Read entire backup file...
Reading backup file: 100.0%... done!
Database version: 79
Attempting to migrate database from version 79 to version 170...
[Error]: During sqlite3_prepare_v2(): table mms has no column named viewed_receipt_count
         -> Query: "INSERT INTO mms (date, date_received, date_server, thread_id, address, address_device_id, msg_box, body, read, ct_l, exp, m_type, m_size, st, tr_id, subscription_id, receipt_timestamp, delivery_receipt_count, read_receipt_count, viewed_receipt_count, mismatched_identities, network_failures, expires_in, expire_started, notified, quote_id, quote_author, quote_body, quote_missing, quote_mentions, quote_type, shared_contacts, unidentified, link_previews, view_once, reactions_unread, reactions_last_seen, remote_deleted, mentions_self, notified_timestamp, server_guid, message_ranges, story_type, parent_story_id, export_state, exported) SELECT date_sent, date, date_server, thread_id, address, address_device_id, type, body, read, null, 0, 0, 0, status, null, subscription_id, receipt_timestamp, delivery_receipt_count, read_receipt_count, 0, mismatched_identities, null, expires_in, expire_started, notified, 0, 0, null, 0, null, 0, null, unidentified, null, 0, reactions_unread, reactions_last_seen, remote_deleted, 0, notified_timestamp, server_guid, null, 0, 0, export_state, exported FROM sms WHERE _id IS ? RETURNING _id"
[Error]: copying sms._id: 1
[Error]: Failed to migrate currently unsupported database version (79). Please upgrade your database
BACKUPFILE VERSION: 0
BACKUPFILE SIZE: 158213098
COUNTER: 2780193757
Reading backup file: 100.0%...
Read entire backup file...
Reading backup file: 100.0%... done!
Database version: 79
Database version: 79
TABLE_NAME|COLUMN_NAME
archived_count_index|(NULL)
constraint_spec|_id
constraint_spec|factory_key
constraint_spec|job_spec_id
dependency_spec|_id
dependency_spec|depends_on_job_spec_id
dependency_spec|job_spec_id
draft_thread_index|(NULL)
drafts|_id
drafts|thread_id
drafts|type
drafts|value
group_id_index|(NULL)
group_receipt_mms_id_index|(NULL)
group_receipts|_id
group_receipts|address
group_receipts|mms_id
group_receipts|status
group_receipts|timestamp
group_receipts|unidentified
group_recipient_id_index|(NULL)
groups|_id
groups|active
groups|avatar
groups|avatar_content_type
groups|avatar_digest
groups|avatar_id
groups|avatar_key
groups|avatar_relay
groups|decrypted_group
groups|group_id
groups|master_key
groups|members
groups|mms
groups|recipient_id
groups|revision
groups|timestamp
groups|title
identities|_id
identities|address
identities|first_use
identities|key
identities|nonblocking_approval
identities|timestamp
identities|verified
job_spec|_id
job_spec|create_time
job_spec|factory_key
job_spec|is_running
job_spec|job_spec_id
job_spec|lifespan
job_spec|max_attempts
job_spec|max_backoff
job_spec|max_instances
job_spec|next_run_attempt_time
job_spec|queue_key
job_spec|run_attempt
job_spec|serialized_data
job_spec|serialized_input_data
key_value|_id
key_value|key
key_value|type
key_value|value
megaphone|_id
megaphone|event
megaphone|finished
megaphone|first_visible
megaphone|last_seen
megaphone|seen_count
mention|_id
mention|message_id
mention|range_length
mention|range_start
mention|recipient_id
mention|thread_id
mention_message_id_index|(NULL)
mention_recipient_id_thread_id_index|(NULL)
mms|_id
mms|address
mms|address_device_id
mms|body
mms|ct_cls
mms|ct_l
mms|ct_t
mms|d_rpt
mms|d_tm
mms|date
mms|date_received
mms|date_server
mms|delivery_receipt_count
mms|exp
mms|expire_started
mms|expires_in
mms|m_cls
mms|m_id
mms|m_size
mms|m_type
mms|mentions_self
mms|mismatched_identities
mms|msg_box
mms|network_failures
mms|notified
mms|part_count
mms|previews
mms|pri
mms|quote_attachment
mms|quote_author
mms|quote_body
mms|quote_id
mms|quote_mentions
mms|quote_missing
mms|reactions
mms|reactions_last_seen
mms|reactions_unread
mms|read
mms|read_receipt_count
mms|read_status
mms|remote_deleted
mms|resp_st
mms|resp_txt
mms|retr_st
mms|retr_txt
mms|retr_txt_cs
mms|reveal_duration
mms|reveal_start_time
mms|rpt_a
mms|rr
mms|shared_contacts
mms|st
mms|sub
mms|sub_cs
mms|subscription_id
mms|thread_id
mms|tr_id
mms|unidentified
mms|v
mms_ad|(NULL)
mms_ai|(NULL)
mms_au|(NULL)
mms_date_sent_index|(NULL)
mms_date_server_index|(NULL)
mms_fts|body
mms_fts|thread_id
mms_fts_config|k
mms_fts_config|v
mms_fts_data|block
mms_fts_data|id
mms_fts_docsize|id
mms_fts_docsize|sz
mms_fts_idx|pgno
mms_fts_idx|segid
mms_fts_idx|term
mms_message_box_index|(NULL)
mms_reactions_unread_index|(NULL)
mms_read_and_notified_and_thread_id_index|(NULL)
mms_read_index|(NULL)
mms_thread_date_index|(NULL)
mms_thread_id_index|(NULL)
one_time_prekeys|_id
one_time_prekeys|key_id
one_time_prekeys|private_key
one_time_prekeys|public_key
part|_data
part|_id
part|aspect_ratio
part|blur_hash
part|borderless
part|caption
part|cd
part|cdn_number
part|chset
part|cid
part|cl
part|ct
part|ctt_s
part|ctt_t
part|data_hash
part|data_random
part|data_size
part|digest
part|display_order
part|encrypted
part|fast_preflight_id
part|file_name
part|fn
part|height
part|mid
part|name
part|pending_push
part|quote
part|seq
part|sticker_emoji
part|sticker_id
part|sticker_pack_id
part|sticker_pack_key
part|thumbnail
part|thumbnail_random
part|transfer_file
part|transform_properties
part|unique_id
part|upload_timestamp
part|voice_note
part|width
part_data_hash_index|(NULL)
part_data_index|(NULL)
part_mms_id_index|(NULL)
part_sticker_pack_id_index|(NULL)
pending_push_index|(NULL)
push|_id
push|body
push|content
push|device_id
push|server_delivered_timestamp
push|server_guid
push|server_timestamp
push|source
push|source_uuid
push|timestamp
push|type
recipient|_id
recipient|blocked
recipient|call_ringtone
recipient|call_vibrate
recipient|capabilities
recipient|color
recipient|default_subscription_id
recipient|dirty
recipient|email
recipient|force_sms_selection
recipient|group_id
recipient|group_type
recipient|gv2_capability
recipient|last_profile_fetch
recipient|mention_setting
recipient|message_expiration_time
recipient|message_ringtone
recipient|message_vibrate
recipient|mute_until
recipient|notification_channel
recipient|phone
recipient|profile_family_name
recipient|profile_joined_name
recipient|profile_key
recipient|profile_key_credential
recipient|profile_sharing
recipient|registered
recipient|seen_invite_reminder
recipient|signal_profile_avatar
recipient|signal_profile_name
recipient|storage_proto
recipient|storage_service_key
recipient|system_contact_uri
recipient|system_display_name
recipient|system_info_pending
recipient|system_phone_label
recipient|system_phone_type
recipient|system_photo_uri
recipient|unidentified_access_mode
recipient|username
recipient|uuid
recipient|uuid_supported
recipient_dirty_index|(NULL)
recipient_group_type_index|(NULL)
recipient_storage_service_key|(NULL)
recipient_username_index|(NULL)
remapped_recipients|_id
remapped_recipients|new_id
remapped_recipients|old_id
remapped_threads|_id
remapped_threads|new_id
remapped_threads|old_id
sessions|_id
sessions|address
sessions|device
sessions|record
signed_prekeys|_id
signed_prekeys|key_id
signed_prekeys|private_key
signed_prekeys|public_key
signed_prekeys|signature
signed_prekeys|timestamp
sms|_id
sms|address
sms|address_device_id
sms|body
sms|date
sms|date_sent
sms|date_server
sms|delivery_receipt_count
sms|expire_started
sms|expires_in
sms|mismatched_identities
sms|notified
sms|person
sms|protocol
sms|reactions
sms|reactions_last_seen
sms|reactions_unread
sms|read
sms|read_receipt_count
sms|remote_deleted
sms|reply_path_present
sms|service_center
sms|status
sms|subject
sms|subscription_id
sms|thread_id
sms|type
sms|unidentified
sms_ad|(NULL)
sms_ai|(NULL)
sms_au|(NULL)
sms_date_sent_index|(NULL)
sms_date_server_index|(NULL)
sms_fts|body
sms_fts|thread_id
sms_fts_config|k
sms_fts_config|v
sms_fts_data|block
sms_fts_data|id
sms_fts_docsize|id
sms_fts_docsize|sz
sms_fts_idx|pgno
sms_fts_idx|segid
sms_fts_idx|term
sms_reactions_unread_index|(NULL)
sms_read_and_notified_and_thread_id_index|(NULL)
sms_read_index|(NULL)
sms_thread_date_index|(NULL)
sms_thread_id_index|(NULL)
sms_type_index|(NULL)
sqlite_autoindex_constraint_spec_1|(NULL)
sqlite_autoindex_dependency_spec_1|(NULL)
sqlite_autoindex_identities_1|(NULL)
sqlite_autoindex_job_spec_1|(NULL)
sqlite_autoindex_key_value_1|(NULL)
sqlite_autoindex_megaphone_1|(NULL)
sqlite_autoindex_one_time_prekeys_1|(NULL)
sqlite_autoindex_recipient_1|(NULL)
sqlite_autoindex_recipient_2|(NULL)
sqlite_autoindex_recipient_3|(NULL)
sqlite_autoindex_recipient_4|(NULL)
sqlite_autoindex_remapped_recipients_1|(NULL)
sqlite_autoindex_remapped_threads_1|(NULL)
sqlite_autoindex_sessions_1|(NULL)
sqlite_autoindex_signed_prekeys_1|(NULL)
sqlite_autoindex_sticker_1|(NULL)
sqlite_autoindex_storage_key_1|(NULL)
sqlite_sequence|name
sqlite_sequence|seq
sticker|_id
sticker|content_type
sticker|cover
sticker|emoji
sticker|file_length
sticker|file_path
sticker|file_random
sticker|installed
sticker|last_used
sticker|pack_author
sticker|pack_id
sticker|pack_key
sticker|pack_order
sticker|pack_title
sticker|sticker_id
sticker_pack_id_index|(NULL)
sticker_sticker_id_index|(NULL)
storage_key|_id
storage_key|key
storage_key|type
storage_key_type_index|(NULL)
thread|_id
thread|archived
thread|date
thread|delivery_receipt_count
thread|error
thread|expires_in
thread|has_sent
thread|last_scrolled
thread|last_seen
thread|message_count
thread|pinned
thread|read
thread|read_receipt_count
thread|recipient_ids
thread|snippet
thread|snippet_content_type
thread|snippet_cs
thread|snippet_extras
thread|snippet_type
thread|snippet_uri
thread|status
thread|type
thread|unread_count
thread_pinned_index|(NULL)
thread_recipient_ids_index|(NULL)
bepaald commented 2 months ago

Sorry for bringing up an edge-case, but

No problem, v79 is pretty old but I'll see what I can do.

bepaald commented 2 months ago

I gave this a go, it may be fixed. Please give it a try and let me know if it works. Thanks!

drzraf commented 2 months ago

Needed --migratedb and --setselfid and worked perfectly. Thank you!

bepaald commented 2 months ago

That's good news. Thanks for the feedback.

I think I'll work on trying to improve the function that scans for selfid automatically, but — especially for older databases — it's not always possible, so a manual --setselfid might always be required.

Thanks!