Home > Software design >  How to archive documents stored in SQL Server
How to archive documents stored in SQL Server

Time:07-01

I have a client for which I did a portal which manages documents used by their company. The documents are stored in SQL Server. This all works great.

Now, a few years later, there are 130,000 documents, most of which are no longer needed. The database is up to 200 gigs, and the cost of Azure Db gets costly above 250 gigs.

However, they don't want to just delete the old documents, as on occasion, they are needed. So what are my choices? They are creating about 50,000 documents per year.

  1. Just let the database grow larger and pay the price?

  2. Somehow save them to a disk somewhere? Seems like 130,000 documents in storage is going to be a task to manage in itself.

  3. Save the current database somewhere offline? But accessing the documents off the database would be difficult.

  4. Rewrite the app to NOT store the files in SQL Server, and instead save/retrieve from a storage location.

Any ideas welcome.

CodePudding user response:

Export the backup file in Azure Blob storage in archive mode which will cost less and easy to import back to database when required. Delete the records from database afterwards.

  1. Click on the Export option for your SQL database in Azure SQL Server.

enter image description here

  1. Select the Storage account in Azure where you want to store the backup file.

enter image description here

Once the backup is available in storage account, change the access tier to archive by following this tutorial - Archive an existing blob.

  • Related