none
How a can delete old versions

    Question

  • I have a script to do a backup, if a week number is pair it goes to one external disk if not to it goes to a another external disk.

    In this way i only have 2 weeks backed up. (15 days).

    But right know i have all the old versions too when i try recovered it appears there (127 at all).

    How can i delete this old versions ? to stay with only the last 15 days.

    Thx.

    Rafael Silva

    .
    Friday, February 27, 2009 7:57 PM

Answers

  •  

    Hello,

       We can delete older backups and free the space occupied by them using the following two ways:

     

    1.       Deleting System State Backup: wbadmin delete systemstatebackup –keepversions:10   

    The above command will keep the latest 10 versions and delete the rest all the system state backups.

     

    2.       Deleting other backups:  Backup application stores multiple backup versions in the VSS shadow copies. Hence, older backup version can be deleted by deleting older shadow copy. Commands to list and delete VSS shadow copies are below. They need to be run in an elevated command window.

     

    ·         vssadmin list shadows /for=x: – for listing the snapshots on x: where x: is the backup location

    ·         vssadmin delete shadows /for=x:  /oldest – for delete the oldest shadow copy. It can be called multiple times in case there is need to delete multiple older backups.

     

    Note: wbadmin get versions or backup UI would still report deleted backups until next backup runs. At end of each backup – non-existent backups are removed from the backup catalog.

     

    Sree,

           Can you please double check if there is any space in between “keepversions:” and the value “30”. In the mean time can you please try using the

           following command that will delete the oldest System State Backup to just unblock you:

          

           wbadmin delete systemstatebackup –deleteOldest

    • Proposed as answer by Chirag Gupta Tuesday, March 03, 2009 3:24 AM
    • Marked as answer by Christine Fok Friday, July 31, 2009 1:22 AM
    Monday, March 02, 2009 10:06 AM

All replies

  • Hi,

    I am also want know how to delete the old backup copies. In windows server backup when I view the backup details it showing 203 (days) copies and remaining space in HDD is 9%. So I would like to delete the old backups. I have tried the below mentioned method.

    To delete all system state backups, except the thirty most recent, type:

    wbadmin delete systemstatebackup -keepVersions:30

    I got the msg like

    ERROR - The value for option: keepVersions is missing. See usage below.

     

    Anyone pls help...

     

    Regards,


    Sree
    Friday, February 27, 2009 8:40 PM
  •  

    Hello,

       We can delete older backups and free the space occupied by them using the following two ways:

     

    1.       Deleting System State Backup: wbadmin delete systemstatebackup –keepversions:10   

    The above command will keep the latest 10 versions and delete the rest all the system state backups.

     

    2.       Deleting other backups:  Backup application stores multiple backup versions in the VSS shadow copies. Hence, older backup version can be deleted by deleting older shadow copy. Commands to list and delete VSS shadow copies are below. They need to be run in an elevated command window.

     

    ·         vssadmin list shadows /for=x: – for listing the snapshots on x: where x: is the backup location

    ·         vssadmin delete shadows /for=x:  /oldest – for delete the oldest shadow copy. It can be called multiple times in case there is need to delete multiple older backups.

     

    Note: wbadmin get versions or backup UI would still report deleted backups until next backup runs. At end of each backup – non-existent backups are removed from the backup catalog.

     

    Sree,

           Can you please double check if there is any space in between “keepversions:” and the value “30”. In the mean time can you please try using the

           following command that will delete the oldest System State Backup to just unblock you:

          

           wbadmin delete systemstatebackup –deleteOldest

    • Proposed as answer by Chirag Gupta Tuesday, March 03, 2009 3:24 AM
    • Marked as answer by Christine Fok Friday, July 31, 2009 1:22 AM
    Monday, March 02, 2009 10:06 AM
  • Hi Bikash,

    Thanks for your reply. I did double check the command it is correct. I have a doubt, if we use -deleteOldest command it will remove backup of how many days/copies? or it will remove all old backup's.

    I heard that,

       Automatic disk usage management. After you configure a disk for a scheduled backup, Windows Server Backup automatically manages the disk usage—you do not need to be concerned about running out of disk space after repeated backups. Windows Server Backup will automatically reuse the space of older backups when creating new backups. The management tool displays the backups that are available and the disk usage information. This can help you plan for provisioning additional storage to meet your recovery time objectives.


    Link : http://searchwindowsserver.techtarget.com/tip/0,289483,sid68_gci1335638,00.html


    In this I like to know, When no space for the next backup that time it will delete automatically only one old backup or how?. If yes how could be system performance? it will effect anything?

    Sree
    Tuesday, March 03, 2009 1:34 PM
  • Hello Sree, 
       

    -deleteOldest option for deleting system state backup would only delete the oldest version.

     

    In case the disk is running out of space, the new backup will try to reclaim space from the older VSS shadow copies. So

    some of the older backup versions would get deleted automatically.

     

    The wbadmin commands are not supported in PowerShell in LongHorn Release. So if you trying the command in PowerShell it may not
    work. Try running the same command in an elevated command window.

    If you still find issue in deleting the older System State Backups then please send the logs.

    For sending the logs:

    zip the contents of %windir%\logs\windowsserverbackup folder and send to bikasha-nospam@microsoft.com (only use the highlighted letters this is to avoid spam)

    Wednesday, March 04, 2009 3:22 PM
  • Hello Sree,
       Are you able to delete the System State Backup using the information provided above? If not can you please send us the logs using the instruction
       mentioned above.

    Thanks
    Bikash

    Tuesday, April 07, 2009 5:50 AM
  • Hi Bikash,

    Really I am Sorry replying after a long time.

    In case the disk is running out of space, the new backup will try to reclaim space from the older VSS shadow copies. So

    some of the older backup versions would get deleted automatically.  So we didn't tried to delete our old backup copies. 

    Thanks for your reply...


    Sree
    Tuesday, April 07, 2009 9:54 PM
  • What if I have decided I don't want to use the Windows backup anymore, but this thing has consumed 190 GB of space on a 200 GB drive which I'd like to use for something entirely different, and I need more than the 10 GB currently free to do it?

    Can I just pretend there is more space than is listed free under Explorer and start adding data, and as that data is written, VSS will just automatically delete old backups to make room for a bunch of, say, ZIP files that I copy to that drive?

    Do I really need to use the VSS delete shadows command to dump all those old backups one by one according to their GUID as noted under vss list shadows? (since the vss delete shadows /for:e:/Oldest doesn't seem to work)?

    Monday, November 08, 2010 5:48 AM
  • is there was way to say only keep 1 copy of the backup instead of 20? or 200?  
    Friday, January 28, 2011 7:13 PM
  •  

    Hello,

       We can delete older backups and free the space occupied by them using the following two ways:

     

    1.       Deleting System State Backup: wbadmin delete systemstatebackup –keepversions:10   

    The above command will keep the latest 10 versions and delete the rest all the system state backups.

     

    2.       Deleting other backups:  Backup application stores multiple backup versions in the VSS shadow copies. Hence, older backup version can be deleted by deleting older shadow copy. Commands to list and delete VSS shadow copies are below. They need to be run in an elevated command window.

     

    ·         vssadmin list shadows /for=x: – for listing the snapshots on x: where x: is the backup location 

     

     

     

     

    ·         vssadmin delete shadows /for=x:  /oldest – for delete the oldest shadow copy. It can be called multiple times in case there is need to delete multiple older backups. 

     

     

    Note: wbadmin get versions or backup UI would still report deleted backups until next backup runs. At end of each backup – non-existent backups are removed from the backup catalog.

     

    Sree,

           Can you please double check if there is any space in between “keepversions:” and the value “30”. In the mean time can you please try using the

           following command that will delete the oldest System State Backup to just unblock you:

          

           wbadmin delete systemstatebackup –deleteOldest

     

     

     

    Hi Bikash,

    I tried your VSS approach to delete the snapshot created with Windows Server Backup. The command I used is:

    vssadmin delete shadows /shadow={backup ID}

    The result I got is:

    Error: Snapshots were found, but they were outside of your allowed context.  Try
     removing them with the
    backup application which created them.

    I copied the error message literally, even the format is incorrect!!

    I really doubt that the Windows Server Backup is a half-baked feature. Otherwise, how could such a simple deletion so difficult to be done?

    Thanks,

    Sam

     

    Update:

    According to here, it seems this IS a half-baked feature...

     


    sam witwiki

    • Edited by SoBigSoBig Tuesday, April 05, 2011 4:03 PM refine
    Tuesday, April 05, 2011 4:00 PM
  • are you going to impement a gui solution to delete past version like on windows 7 ?

    I cant see such a thing on windows server 2008 r2 yet

    Tuesday, April 05, 2011 7:53 PM
  • the Above command wiill work but there is no space between systemstatebackup and -deletedOldest.

    the command is wbadmin delete systemstatebackup–deleteOldest

     

    this worked for me.


    NetOnsite Solutions
    Tuesday, June 07, 2011 1:53 PM
  • Remove the Space after systemstatebackup

    NetOnsite Solutions
    Tuesday, June 07, 2011 1:58 PM
  • I woould like to add this as a scheduled task. Do someone has a some kind of scitpt??

    Tuesday, July 19, 2011 12:35 PM