FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 63 forks source link

FBStreamingBackup only backs up data #1108

Closed iWhacko closed 9 months ago

iWhacko commented 1 year ago

Our application connects to a firebird database on the local network.

Some operators have the ability to make a backup from the application. However we found that the backup seems to be incomplete.

When using the command line tools to import the backup into a new database, an message appears asking for "disk2" of the backup. Checking the database, we noticed it does not contain our stored procedures, functions triggers. etc.

However, FBStreamingBackup completed with a success message in our application.

We would like to know if this is a bug, a limitation on the api, or do we need to apply some more parameters to our call:

            var backup = new FbStreamingBackup(connectionStr);
            backup.OutputStream = outputStream;
            backup.ExecuteAsync();
cincuranet commented 1 year ago

You're missing await on the last line. Are you sure you're not ending prematurely?

iWhacko commented 1 year ago

You are right, this was a quick write up, we tried it the synchronised way to with execute(); But it has the same result

cincuranet commented 1 year ago

Not sure what your outputStream is and what's it doing (flushing, etc.). Here's a test https://github.com/FirebirdSQL/NETProvider/blob/51b1bbe16ca45c4c55b1dffdf289d0ccfcdd4a03/src/FirebirdSql.Data.FirebirdClient.Tests/FbServicesTests.cs#L82 that does B&R cycle and as expected it works.

iWhacko commented 1 year ago

Alright I will try it, but that looking at the code it's just a simple database backup. It doesnt create any triggers etc. also it doesn't delete the database in between or restore to another database, so if it does not backup triggers etc, they would still be there since it's restoring to a database that does have them.

I will test it some more, and try to supply you with a test scenario.