Fix VBO unindexed repository by editing PostgreSQL with PGAdmin

Fixing an Unindexed Backup Repository in Veeam Backup for Microsoft 365 v8.x (PostgreSQL)

Overview

When a Veeam Backup for Microsoft 365 (VB365) backup repository becomes stuck in an Unindexed state, new backups and restores can stall. The root cause is usually an interrupted or failed repository indexing session. This guide walks you through safely resetting the indexing_state flag in the VB365 PostgreSQL database and restarting the indexing session so the repository returns to a healthy state.

Important — Read First

  • Direct database edits are unsupported by Veeam and should only be done when recommended by Veeam Support or when you fully understand the risk.
  • Always create a full, tested backup of the VB365 configuration database before making changes.
  • Perform this maintenance during a planned outage window; stop all backup and backup‑copy jobs that use the affected repository.

Prerequisites

  1. Administrative access to the VB365 server (PowerShell and OS admin rights).
  2. Database credentials for the Veeam PostgreSQL instance (default user is usually veeam or postgres).
  3. pgAdmin 4 installed on your workstation or the VB365 server.
  4. The repository name and repository GUID (we’ll collect this in Step 1).
  5. All active backup, copy, and restore jobs paused or stopped for the affected organization.

Step 1 — Identify the Repository GUID

Open an elevated PowerShell on the VB365 server and run:

Import-Module Veeam.Archiver.PowerShell
$repository = Get-VBORepository -Name "<Repository Name>"
$repository | Select-Object Name, Id, IsIndexed

Example output:

Name             Id                                     IsIndexed
---- -- ---------
Unindexed Repo f7bf9987-6221-4f70-b8f6-ca6654e7d567 False

Record the Id (GUID) for later.

TipIsIndexed should be False when the repository is unindexed.


Step 2 – Install pgAdmin (if needed)

  • Download pgAdmin 4 from https://www.pgadmin.org/download/ and install.
  • During install, note the port (default 5432) and ensure outbound access if connecting remotely.

Step 3 — Connect to the Veeam PostgreSQL Server

  1. Launch pgAdmin.
  2. Right‑click Servers → Register → Server….
  3. General tab → Name the connection (e.g., Veeam‑PG).
  4. Connection tab →
    1. Host/Address: hostname or IP of the PostgreSQL server (often the VB365 server itself).
    1. Port: 5432 (unless custom).
    1. Maintenance Database: postgres
    1. Username / Password
  5. Click Save and expand the new server node.

Step 4 — Open the VB365 Database in Query Tool

  1. Expand Databases → locate the VB365 database (commonly named VeeamBackup365).
  2. Right‑click the database → Query Tool.


Step 5 — Verify Repository State

Run, by pasting this into the query tool and clicking on the PLAY button to run the query:

SELECT id,
       name,
       indexing_state
FROM   public.repositories
ORDER  BY id ASC;
  • Confirm the row that matches the GUID from Step 1.
  • If indexing_state is not 4 (healthy), continue to Step6.


Step 6 — Reset the Indexing State

In the same Query Tool window:

UPDATE repositories
SET indexing_state = 0
WHERE id = 'f7bf9987-6221-4f70-b8f6-ca6654e7d567'; 
  • Verify that 1 row was affected.
  • If you accidentally commit the wrong value, restore the database backup you created before Step 6.


Step 7 — Restart the Indexing Session

Back in elevated PowerShell:

Import-Module Veeam.Archiver.PowerShell
$repository = Get-VBORepository -Name "Unindexed Repo"
Start-VBORepositoryIndexingSession -Repository $repository

Step 8 — Monitor Progress

  • In the VB365 GUI, the repository should move from UnindexedIndexing. (While indexing is running, the repository shows under the Unindexed filter. Once indexing completes it simply disappears from that filter—this indicates the repository is healthy again (the GUI does not display a separate “Ready” status).
  • Indexing time depends on repository size; allow it to complete before resuming jobs.

Step 9 — Resume Jobs

Once indexing reaches 100 % and the repository state is Ready:

  1. Resume or enable any paused backup, copy, or restore jobs.
  2. Monitor the next job run to ensure data processing resumes normally.

Rollback Procedure (If Needed)

If the repository fails to index or other errors occur:

  1. Stop all VB365 services (Get-Service Veeam* | Stop-Service -Force -Verbose from an elevated CMD/PowerShell).
  2. Restore the database backup you took before Step 6.
  3. Start services and contact Veeam Support with logs.

Troubleshooting Tips

  • Locks – If Start‑VBORepositoryIndexingSession hangs at 0 %, ensure all jobs that touch the repository are stopped and no Explorer sessions are open.
  • Permissions – The account used in pgAdmin must have UPDATE rights on the database.
  • Space – Indexing writes temporary files to the repository path; ensure free disk space.
  • Logs – Check C:\ProgramData\Veeam\Backup365\Logs\Veeam.Archiver.Service*.log for detailed errors.

Conclusion

Resetting the indexing_state flag to 0 and re‑triggering an indexing session is an effective way to recover a repository stuck in an Unindexed state. Always follow best practices—back up first, perform changes during maintenance windows, and validate success before placing the repository back into production rotation.



Document version: 2025‑04‑11

Scroll to Top