Customize backup file name

By default SQLBackupAndFTP stores backups in file names like DatabaseNameYYYYMMDDHHMM.zip (eg Pubs201801011120.zip). But you can also use custom file names if you have such needs

Why use custom formats?

If you want to use it to overwrite the old files – you shouldn’t. There’s an auto-delete section in destination settings that allows you to set auto-delete for old files after a specified number of months/days.

If you store files in Dropbox or other cloud storage that supports versioning, you may choose no date format so that the new file overwrites the old, but Dropbox takes care of storing all the versions of the file.

If you use a script to restore a database on another server, then you may want to use no date file naming. Note however that very soon we will be releasing “Restore job” functionality that allows to set up replication without custom file names.

How to set a custom format?

In SQLBackupAndFTP go to Compression Settings (In Compression section click Settings gear icon) and select one of the formats from the list:

Note that Full backups have no suffix, Differential end with *diff.zip and Transaction Log backup files end with *log.zip

Limitations

By using custom backup file names you are breaking a few things, so before you do that, make sure you are very clear of the trade-offs.

  1. Auto-delete won’t work with the “no date” format because it needs a date in the file name to understand when it is time to delete it. It will still work if you have YYYYMMDD format
  2. Tran log backups should not be used with any custom format because they’d overwrite each other.
  3. overwrite the full backup file made on the same day and would make the restore impossible. Only basic full backups should be used.
  4. The automated restore (the one done through our interface) would work only in basic full backup restore scenarios.

Basically, you have to know what you are doing if you are using custom formats.

 

9 thoughts on “Customize backup file name

  1. I wish I could create my own format. For example databasename-YYYY-MM-DD.7z would be so much easier to read when working with these backup files.
    Thanks for considering this.

  2. I suggest MMM instead of just having MM. This is more readable and meaningul and avoids confusion when the month is 7 and the date is 6 e.g. DBNAME-2021JUL061030.zip (instead DBNAME-202107061030.zip).

  3. Hi there!

    It’s possible to use a name format like Code-DatabaseNameYYYYMMDD.bak?

    I need to backup a lot of shops to a central server and restore the backups to it thus having a centralized location with a DB per shop.

    Thanks,

    1. Hi Rafael,

      Sorry, but all the available formats are specified in the screenshot in the blog post.

      If you need to manage many servers from one place, please take a look at our other backup tool SqlBak. SqlBak has a very convenient Dashboard page to mage the connected servers.

      Thank you!

  4. Ok, I seems like I am not the only one who wants to have more options.

    I hope that you are willing to consider just a very little extra option.

    A dropdown box to select a delimiter character for in between the database name and the time stamp. Of course is should be only characters that are accepted by any OS.

    This will help u a lot.

    Thank you.

    1. Hello Harm,

      Thank you for your request. It has been forwarded to our development team for consideration.

      Thank you for using SQLBackupAndFTP.

Leave a Reply

Your email address will not be published. Required fields are marked *