Standalone backup agent for Microsoft Windows servers and workstations (formerly Veeam Endpoint Backup FREE)
Post Reply
mcbsys
Influencer
Posts: 19
Liked: 5 times
Joined: Sep 07, 2018 3:23 pm
Contact:

How to fully exclude SQL from Veeam Free backup?

Post by mcbsys »

This pertains to Veeam Free 6.0.2.1090. I've opened support case number 06391225 and am awaiting a reply, but since it's a free product with no promise of support, I thought I would try here as well.

I'm running Server 2022 with an instance of SQL Express installed as the default SQL instance (not named SQLEXPRESS as is usually is). I have a complete SQL Maintenance Solution implemented that is doing full and log backups on a set schedule. Veeam should only back up the flat file backups; it should not touch SQL at all.

I found this post with a recommendation for a registry entry to exclude SQL:

veeam-agent-for-windows-f33/veeam-endpo ... ml#p230632

HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Endpoint Backup

After adding this in ExcludeSqlDatabasesFromBackup:

MSSQLSERVER:;

I now see this in the Veeam job log:

Code: Select all

[06.11.2023 02:00:48] <01> Info Sending Microsoft SQL database names to exclude from freeze:
[06.11.2023 02:00:48] <01> Info Instance: 'MSSQLSERVER' DB: ';'.
[06.11.2023 02:00:48] <01> Info VSSControl: Trying to exclude databases from freeze
[06.11.2023 02:00:48] Info <3308> ExcludeSqlDatabase
[06.11.2023 02:00:48] Info <3308> Adding component to excluding list, writerId: {a65faa63-5ea8-4ebc-9dbd-a0c4db26912a}, instanceId: {00000000-0000-0000-0000-000000000000}, componentName: ;, logicalPath: MSSQLSERVER.
[06.11.2023 02:00:48] Info <3308> ExcludeSqlDatabase. Ok.
[06.11.2023 02:00:48] <01> Info List of Microsoft SQL database names to exclude from freeze was successfully sent.
That did in fact eliminate the freeze and thaw events in the SQL log.

However a few minutes later, Veeam tries to back up the SQL logs anyway, e.g.

Code: Select all

[06.11.2023 02:03:32] Info <3308> Database found: MyDB. Recovery model: 1. Is readonly: false. State: 0.
[06.11.2023 02:03:32] Warning <3308> Cannot truncate SQL logs for database: MyDB. Code = 0x80040e14
[06.11.2023 02:03:32] Warning <3308> Code meaning = IDispatch error #3092
[06.11.2023 02:03:32] Warning <3308> Source = Microsoft OLE DB Driver for SQL Server
[06.11.2023 02:03:32] Warning <3308> Description = The server principal "NT AUTHORITY\SYSTEM" is not able to access the database "MyDB" under the current security context.
[06.11.2023 02:03:32] Warning <3308> No OLE DB Error Information found: hr = 0x80004005
The log backup fails because the SYSTEM account, by design, cannot access SQL. That's good--log backup would be especially bad as it would interfere with the log chain created by the main SQL maintenance plan. But why try at all?

How do I tell Veeam to leave SQL alone?

Thanks and regards,
mcbsys
Influencer
Posts: 19
Liked: 5 times
Joined: Sep 07, 2018 3:23 pm
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by mcbsys »

I neglected to mention that I am getting a SQLWRITER error in the Application event log every day during Veeam Backup. so it seems Veeam is still messing with with the SQL VSS writer in spite of excluding SQL for the entire server.

Log Name: Application
Source: SQLWRITER
Date: 11/6/2023 2:03:27 AM
Event ID: 24581
Level: Error
Description: Sqllib error: System table sys.sysdatabases in SQL Server instance MYSERVER is empty.
Mike.Powell
Veeam Software
Posts: 8
Liked: 2 times
Joined: Jun 13, 2016 6:19 pm
Full Name: Mike Powell
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by Mike.Powell »

VAW uses VSS for backup. if VSS is called against the volume, the writers are notified and sql logs will see it. The Veeam SQL plug-in would do what you're looking for.

https://helpcenter.veeam.com/docs/backu ... ml?ver=120
mcbsys
Influencer
Posts: 19
Liked: 5 times
Joined: Sep 07, 2018 3:23 pm
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by mcbsys »

@Mike.Powell, thanks for the reply. I don't think that plug-in applies to the stand-alone Free agent (no Backup & Replication server or backup repository)? Also it looks like the plugin is about how to do SQL backups. I'm trying to figure out how to make it not do SQL backups. This might mean telling it to ignore/exclude the SQL VSS writer (SentinelOne has an option like that).

For simplicity, I wouldn't mind if it does SQL backups as long as it doesn't mess with the log chain. If I need to do a point-in-time SQL restore, I don't want to have to pull logs from multiple backup locations to assemble a chain. I have time, I may come back to more detailed testing.
lharmer
Service Provider
Posts: 23
Liked: 3 times
Joined: May 05, 2016 2:09 pm
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by lharmer »

If you're happy for the agent to run the SQL backup, 'Copy Mode' should do the trick to stop it interfering with the logs?

https://helpcenter.veeam.com/docs/agent ... tml?ver=60

That's usually specifically for when another application is handling the log truncation, plus means your Agent backup would still contain a valid SQL restore point if you ever needed it.
mcbsys
Influencer
Posts: 19
Liked: 5 times
Joined: Sep 07, 2018 3:23 pm
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by mcbsys »

@lharmer, nice to see that Veeam knows about copy-only vs. log truncation. Unfortunately the wizard for the free Community Edition agent does not have a Guest Processing pane, so there is no UI control over application-aware backup. Can that be adjusted in a configuration file or registry setting? The edition comparison makes it sound like the Community edition doesn't do application-aware backups at all, but it's definitely using VSS on SQL, and according to the SqlWriter log, "Backup type is VSS_BT_FULL".
Gostev
Chief Product Officer
Posts: 31561
Liked: 6725 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by Gostev »

Veeam Agent for Microsoft Windows FREE is designed for endpoint backup, not for server backup.

You could use Veeam Backup & Replication Community Edition instead, this has full basic functionality including application-aware processing for up to 10 physical servers or VMs.
mcbsys
Influencer
Posts: 19
Liked: 5 times
Joined: Sep 07, 2018 3:23 pm
Contact:

Re: How to fully exclude SQL from Veeam Free backup?

Post by mcbsys »

Thanks @Gostev. Seems I looked at the Community Edition but it was overkill for backing up one server? Can't remember if it was system requirements or general complexity that put me off.

I use another program as my primary backup tool, but on servers, I like having Veeam as a secondary backup. FREE works fine on servers except for this SQL issue.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 19 guests