rename backup file

  • Is it a good practice not to rename existing backup file?

    for example I did a full backup of database, later I found out I need to more explicitly name the backup file so that I can easily recognize it. But then I realize the backup file name may be already in the msdb database, if I change the name of the backup file, msdb will not know.

    So later if I restore from UI, it may be a problem?

    Thanks

  • sqlfriends (8/20/2012)


    Is it a good practice not to rename existing backup file?

    for example I did a full backup of database, later I found out I need to more explicitly name the backup file so that I can easily recognize it. But then I realize the backup file name may be already in the msdb database, if I change the name of the backup file, msdb will not know.

    So later if I restore from UI, it may be a problem?

    Thanks

    Did you try to restore it? That will give you your answer... HINT: Can you restore a backup from 1 instance to a different one even though the backupset name is not in the different instance's msdb database?

    Jared
    CE - Microsoft

  • Did you try to restore it? That will give you your answer... HINT: Can you restore a backup from 1 instance to a different one even though the backupset name is not in the different instance's msdb database?

    The hint is a diffrent case, of course I can, I will just need to manually choose the backup device.

    The question I ask is when you restore database use UI, if will automatically list the backup files that is most recent and in chain including full, diff, and log backup, it makes it very handy that you don't need to manually choose the files.

    But through testing, I see the backup file name actually doesn't matter, when listing the most recent backups, it use the backup set ID I think, but not using the backup file name as identifier.

    So it is good to find out that.

    I asked this is because a SQL developer that uses codes to backup and restore database, he told me it is better not to change the backup file name, otherwise it will cause inconsistency for the name in the msdb and the backup file name.

    I checked in the msdb, I can see there is a physical_device_name in table backupmediafamily.

    After I changed the name of backup file name, this here in the table is not changed.

    So I wonder my question may be still valid, is it a good practice not to change backup file name?

    Thanks

  • sqlfriends (8/20/2012)


    Did you try to restore it? That will give you your answer... HINT: Can you restore a backup from 1 instance to a different one even though the backupset name is not in the different instance's msdb database?

    The hint is a diffrent case, of course I can, I will just need to manually choose the backup device.

    The question I ask is when you restore database use UI, if will automatically list the backup files that is most recent and in chain including full, diff, and log backup, it makes it very handy that you don't need to manually choose the files.

    But through testing, I see the backup file name actually doesn't matter, when listing the most recent backups, it use the backup set ID I think, but not using the backup file name as identifier.

    So it is good to find out that.

    I asked this is because a SQL developer that uses codes to backup and restore database, he told me it is better not to change the backup file name, otherwise it will cause inconsistency for the name in the msdb and the backup file name.

    I checked in the msdb, I can see there is a physical_device_name in table backupmediafamily.

    After I changed the name of backup file name, this here in the table is not changed.

    So I wonder my question may be still valid, is it a good practice not to change backup file name?

    Thanks

    Well, in my opinion it is not good practice. The best way is to create the backup with the filename that you want it to be in the first place. Now, when I say this... I mean not to do it often. Mostly because it is just a waste of time. Why would I keep renaming th file instead of backing it up with the name that I want it to be?

    Jared
    CE - Microsoft

  • Thanks, I don't mean I will do it quite often. I will certainly make it correctly at the first place.

    It just happens sometimes.

    So I guess it is better not to rename backup file name, because it makes the inconsistency.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply