openMittsu
openMittsu copied to clipboard
Data back-up import fails due to missing "color" field in the contacts list
I tried to import a Threema data back-up which failed. The GUI message wasn't very helpful but stderr was:
[2024-10-13 13:27:55.162] [main] [warning] Expected field color, but header only contains columns publickey,firstname,nick_name,identity_id,archived,tacid,hidden,lastname,acid,verification,identity.
I was able to work around the issue by appending an additional column with the header color and all empty values. Essentially:
mv contacts.csv contacts.csv.bak
{
read -r line
printf '%s,"color"\n' "$line"
while read -r line; do
printf '%s,""\n' "$line
done
} < contacts.csv.bak > contacts.csv