Knowledge Base

Duplicate Entries

Duplicate Entries

Troubleshooting and preventing duplicate entries in Xero.

Why Duplicates Occur

After Reset Sync State

The most common cause. When you reset sync state:

  • All Blesta-to-Xero mappings are deleted
  • Plugin no longer knows what was synced
  • Next sync creates new entries in Xero
  • Original Xero entries remain

After Plugin Reinstall

Similar to reset - mappings are lost and recreated.

Manual Xero Entry + Sync

If you manually create an entry in Xero, then sync creates another.

Preventing Duplicates

Before Bulk Sync

  1. Check Xero for existing entries
  2. Use Skip Historical for old data
  3. Only sync new records going forward

Before Reset Sync State

Ask yourself:

  • Do I really need to reset?
  • Will I clean up Xero afterward?
  • Can I fix the issue another way?

Sync Recovery Feature

The plugin attempts to match existing Xero entries:

  • Searches for contacts by email
  • Searches for invoices by number
  • Links if found instead of creating duplicate

This helps after reinstall but isn't perfect.

Fixing Duplicate Contacts

In Xero

  1. Go to Contacts in Xero
  2. Find duplicate contacts
  3. Use Xero's Merge contacts feature
  4. Keep the contact linked to Blesta

Update Mapping (Advanced)

If wrong contact is mapped:

  1. Note the correct Xero contact ID
  2. Access database
  3. Update xero_sync_mappings table
  4. Set correct xero_id for the contact

Fixing Duplicate Invoices

Cannot Merge in Xero

Xero doesn't have invoice merge functionality.

Option 1: Delete in Xero

  1. If invoice is DRAFT, delete it
  2. If AUTHORISED, void it
  3. Keep the one linked to Blesta payments

Option 2: Delete in Blesta

If the Blesta invoice is the duplicate:

  1. Void in Blesta
  2. This will void in Xero (if synced)
  3. Keep manual Xero entry

Option 3: Update Mapping (Advanced)

  1. Identify correct Xero invoice
  2. Update mapping in database
  3. Future syncs will update correct invoice

Fixing Duplicate Payments

Duplicate Creates Overpayment

If duplicate payment exists:

  1. Client shows overpaid in Xero
  2. Delete or void the duplicate
  3. Reconcile bank feed

Both Payments Valid

If both are legitimate:

  1. Keep both
  2. Update mapping if needed
  3. Ensure no bank reconciliation issues

Database Cleanup (Advanced)

View Current Mappings

SELECT * FROM xero_sync_mappings 
WHERE company_id = YOUR_COMPANY_ID 
AND entity_type = 'contact';

Remove Duplicate Mapping

DELETE FROM xero_sync_mappings 
WHERE id = MAPPING_ID;

Update Mapping

UPDATE xero_sync_mappings 
SET xero_id = 'NEW_XERO_ID' 
WHERE id = MAPPING_ID;

Warning: Always backup before database changes.

Best Practices

Regular Monitoring

  • Check Xero periodically for duplicates
  • Review sync logs for patterns
  • Address issues early

Careful with Reset

  • Only reset when absolutely necessary
  • Document what exists in Xero first
  • Plan cleanup afterward

Use Skip Historical

  • For new installations with existing data
  • Prevents syncing years of history
  • Start fresh from a specific date
Please rate this article to help us improve our Knowledge Base.

0 0