How to export database as sql in asp net core web api from client side

Semir Hamid 1 Reputation point
2022-12-17T18:17:43.247+00:00

I am using Asp.Net Core Web API and PostgreSQL for the database. How can the admins take the database backup as .sql file and can restore the data back whenever they want. I have nine tables.

Developer technologies ASP.NET ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-12-19T18:11:00.893+00:00

    use the create process api to execute the backup utilities (pg_dimp, pg_dumpall, or pg_basebackup). the utilities must be installed on the server hosting the webapi.

    https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=net-7.0

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.