export names

MAB's profile image MAB posted 1 month ago in Import/Export Permalink

Since a recent update an exported table , e.g. "fish" is exported as "table-fish.sql" I'm guessing there may be a way to change that to, ideally for me, e.g. "fish_2026-02-02.sql" where the last part is the date of export so I can easily and automatically identify which back-up I want. Is that possible and if so how do I find and adjust those settings? On the HeidiSQL help pages it shows a "table tools" screen but I can't find that on my version under tools or preferences tabs. What am I missing / where should I be looking? Thanks

MAB's profile image MAB posted 1 month ago Permalink

Apologies - I found "table tools" screen but the rest of the question is the same. Thanks

ansgar's profile image ansgar posted 1 month ago Permalink

Yes, since v12.12 the export adds the object type (e.g. "table" or "view") as prefix to the file name, but only if you selected the output option "Directory, one file per object".

Details about that change can be read in issue #2212. I experienced data loss before that change, due to files being overwritten.

The file or folder name supports the following placeholders - not really sure what you want to achieve here, but here you see what is possible:

grafik.png

MAB's profile image MAB posted 1 month ago Permalink

You have correctly identified precisely my aim, to automatically create back-ups which do not overwrite previous backups, by appending %date to the name. At present I rename them manually once exported.

Currently I manually select the tables which changed on a particular day and export them.

What I haven't worked out from your helpful answer is how to achieve that to append the date as a suffix.

For example, in the directory, do I just put "%date" so exporting a previously selected table named "fish" becomes "table-fish 20260202 14:00.sql"
That would be fine for my purposes.

MAB's profile image MAB posted 1 month ago Permalink

I tried just putting %date at the end of the directory, so to use your example it created a new sub-directory below the "after" directory called "after 2026-02-06 13_28_29"

That kind-of works in that I have a back-up which I can identify as being made at a particular point in time but every back-up will have exactly the same name so if I looked at two back-ups I would only know which was which from the directory where it was stored (of course, the creation dates will reflect that too).

My current manual renaming method allows me to quickly see in the same directory multiple back-ups and the dates they were made (from the suffix).
If each back-up instance is in a separate sub-directory (i.e. the "%date" method described above) I have to do a search on the parent directory.
Not the end of the world, but different to my aim of just adding a suffix. And both back-ups have the same name which guarantees the risk of confusing them, a problem explicitly avoided with my suffix naming approach.

Please login to leave a reply, or register at first.