I want to set a backup policy for 7 years can you please suggest how retain backup for azure backup

admin Alchemy 0 Reputation points
2023-04-28T20:23:34.3933333+00:00

Need suggestion onbackup I need my postgredb backup through azure backup

policy should retain data for 7 years

need daily backup and data should be there for 7 years

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,500 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 49,331 Reputation points Microsoft Employee Moderator
    2023-04-28T20:46:25.1966667+00:00

    Hello @admin Alchemy Thank you for reaching out to us on Microsoft Q&A platform. Happy to assist!

    To set a backup policy for 7 years for your PostgreSQL database backup through Azure Backup, you can modify the retention rule of the policy template. By default, the retention rule is set to retain each backup for three months**.**

    Here's an example of how to modify the retention rule to retain backups for 7 years:

    {
      "name": "Monthly",
      "objectType": "AzureRetentionRule",
      "isDefault": true,
      "lifecycles": [
        {
          "deleteAfter": {
            "duration": "P7Y",
            "objectType": "AbsoluteDeleteOption"
          },
          "sourceDataStore": {
            "dataStoreType": "VaultStore",
            "objectType": "DataStoreInfoBase"
          },
          "targetDataStoreCopySettings": []
        }
      ]
    }
    

    In this example, the retention rule is set to retain each backup for 7 years. You can modify the duration to any value you want. Once you have modified the retention rule, you can create or update the backup policy using the Azure Backup REST API.

    Doc ref: https://learn.microsoft.com/en-us/azure/backup/backup-azure-database-postgresql

    Let me know if you need more information on how to create or update the backup policy.

    If the response helped, do "Accept Answer" and up-vote it

    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.