Is there more information about where that error occurred? Like table name at least, and hopefully field/column name as well.
The issue is any PRIMARY column may not contain duplicate entries. Usually this column’s data is something that must be unique for each record, like an ID. In WP, this is likely the column ID or something similar.
There’s a good chance the entire record (row) is a duplicate and one of the copies could be safely removed. But I suspect that will not be the only duplicate. I think that perhaps the backup was appended to the original data instead of replacing it. If that is what happened, it’s not something that can be patched up manually by deleting a duplicate row here and there. There are too many records involved.
Here’s what I recommend doing IF there are indeed very many duplicates: Make a new, complete backup of the entire WP database, just for safety. Be sure you don’t overwrite the earlier backup. The current database is unusable, but it’s better to have a broken backup than no backup.
From here, proceed at your own risk. If not done carefully, you could lose a lot of data. That’s why you need a new backup, but backups have been known to fail to restore correctly. Bear in mind you’re taking advice from a random stranger on the internet. That’s risky in itself. I believe this to be the best path forward if there are a lot of duplicates, but I’m not the one taking a risk and I assume no liability if things go wrong. TBH, it’d be much safer to hire a professional to fix this for you, but in fact the procedure isn’t that complicated. Just don’t attempt to hire anyone through these forums, it’s not permitted.
Still willing to proceed? You’re very brave! But with a broken database, I suppose there’s not much more to lose.
Here’s the scary part: Drop (delete) all tables in the WP database. This ensures the backup cannot be appended to existing data. This is done through the phpMyAdmin app, usually accessed through your hosting account. Keep the database itself, just empty it of all tables.
Restore the tables from your last known good backup. Not the one you just made. If all goes well, your site will be back again, just as it was when the backup was made. Any changes, if any, made after this backup will be lost.
I expect you’ll have more questions. I’ll do my best to answer.