Import failing with `could not create unique index`

I believe the easiest path forward for you is to get a working backup and import into a new instance like you tried last.

Let’s try to fix the duplicated data:

# ssh into the machine
cd /var/discourse
./launcher enter app
su postgres
psql
\connect discourse
SELECT * FROM incoming_domains WHERE name LIKE '%homeassistant.home%';

# this should print multiple lines
# use SQL DELETE statements to fix it
# and exit with \q

Can you try the above and ask for more help if you get stuck?