Skip to content

Instantly share code, notes, and snippets.



  • România
View GitHub Profile
paracycle / convert.sql
Created Jul 29, 2013
Convert and merge WhatsApp databases from iPhone format to Android
View convert.sql
-- Clear tables
DROP TABLE chat_list;
DROP TABLE messages;
-- Create new tables
CREATE TABLE chat_list (_id INTEGER PRIMARY KEY AUTOINCREMENT, key_remote_jid TEXT UNIQUE, message_table_id INTEGER);
CREATE TABLE messages (_id INTEGER PRIMARY KEY AUTOINCREMENT, key_remote_jid TEXT NOT NULL, key_from_me INTEGER, key_id TEXT NOT NULL, status INTEGER, needs_push INTEGER, data TEXT, timestamp INTEGER, media_url TEXT, media_mime_type TEXT, media_wa_type TEXT, media_size INTEGER, media_name TEXT, latitude REAL, longitude REAL, thumb_image TEXT, remote_resource TEXT, received_timestamp INTEGER, send_timestamp INTEGER, receipt_server_timestamp INTEGER, receipt_device_timestamp INTEGER, raw_data BLOB, media_hash TEXT, recipient_count INTEGER, media_duration INTEGER, origin INTEGER);
-- Attach Android and iPhone databases
ATTACH 'msgstore.db' AS android;
You can’t perform that action at this time.