Undo mass processing by smart rule

Hello together,

I just accidentally dragged about 3000 painfully individually named documents into the wrong database. Unfortunately, a Smart Rule was active there, which now renamed all the data into meaningless names.

How can I undo this or restore the old name of the documents?

Thank you very much!


Furthermore, I don’t understand how this renaming job could be active, because I explicitly excluded subgroups.

Nevertheless, both subfolders and files are renamed. (Name of the Folder should be “2010”.
CleanShot 2020-09-15 at 22.26.37@2x
To explain again briefly what I have done: I moved a folder to “Legacy” from the Finder. Then I would have expected that the smart-rule would not be active because it is a subgroup.
I checked all other smartrules as well, but they are also restricted to a certain database and always without subgroups. If i remove this filter everything work as expected. What am I doing wrong? or a bug?


AFAIK the only way to undo that would be to play back a backup (i.e. putting the files back in Finder from a backup, and then reimporting them).

Could you pls post your smart rule without the drop-down? I’m currently at a loss to explain why the smart rule triggered - and would like to play with an identical smart rule. What’s your “Suchen in”? i.e. was it (the root of) a database, or a group? Are you using the most current version of DT?

Could you pls explain what you mean? Which filter, and in what way does the smart rule then act differently?

You can’t undo the results of the smart rule. You’d have to rename them again manually or restore a copy of the database from your backups.

  • You don’t have any criteria specified. Why not?

  • Excluding subgroups does not mean to not act on groups. It means ignore the contents of subgroups from being processed.

I wondered about that; but if I understand the OP correctly, he dragged a folder called “2010” from the Finder to a group called Legacy. I would have expected “2010” to be acted on by the smart rule (as it was, becoming “Sonstiges—”), but I don’t think I would have expected the contents of “2010” to have been acted upon (unless using DT3 prior to DT3.0.4, in which case depending on the search location, I might have expected it, but I’m not really sure…)

As the OP has no criteria specified in the smart rule, is that smart rule even responsible for what has happened? My experience is that the rules don’t act if no criteria are defined.

I’m not able to reproduce this issue here.
What other smart rules do you have running on this database?

Current status:

Status before switching to manual:

i use 3.5.2 of devonthink.

That was exactly what I expected. Folders yes, but the content (files) is not touched. But in my example the file is renamed. :frowning:

Currently none. I also thought that I could exclude cross defects with other filters, because the problem was solved after I switched this filter to manual.

This is an effort that one likes to invest for 3000 files. But doesn’t it make sense to be able to reverse some actions (latest 50 files ore so)? Doesn’t that work for server edition either?

When I get a moment, I’ll try and reproduce this tomorrow; as Jim has not been successful in doing so, I wonder whether you have stumbled upon a bug which is only active in very specific conditions. What type of file did you have in the “2010” folder? Were they all of the same time? Can you let me know the name of one or two files (before they were renamed by the rule). How exactly did you import the files?

PS If you don’t have a backup of your files, take a moment to rethink your backup strategy (I know, it’s a bit late to point that out now). You must have taken ages to rename 3000 files - and in that time, one of you strategies should have created one backup at least.

Thank you for your efforts, I had made a gif earlier, but unfortunately deleted it. Can I do it again tomorrow and add the file names etc. At the moment I can’t do anything because I’m having the 3000 files re-read by OCR… But i only use PDF. Moved the folder (which includes one pdf) from the finder into that group.

Feel free to add any further info whenever you have time; I fear anything I do won’t actually help you anyway - but if there is a bug, finding it would help the wider community, so it’s worth my time anyway. I’m sorry for the time you have lost.

Again, please check you backup strategies to see whether they really cover you against the widest range of possible incidents. I posted my strategy a while back.

1 Like

None of the editions have such a mechanism built in for mass undos.

Did you actually move the folder from the Finder into the database, i.e., you have no copy of it in the filesystem any longer?

At the moment I can’t do anything because I’m having the 3000 files re-read by OCR

What do you mean by this??
Why would you run OCR on the documents again?

I doubt that very much, though I don’t have the server edition. I suppose it is more or less DT combined with a web server and another GUI.
And frankly: as with any kind of automation, it gives you a lot of power. Also the power to shoot yourself in the foot (I managed to run a “rm -rf *” once from the root directory of a Unix server – talk about “reverting some 50 files”). No one can safeguard against all kinds of actions (simply imagine a script/rule that moves files to the trash and empties the trash immediately afterwards).

1 Like

I have named the documents in a folder on the FS. From there it had been imported into Devonthink and then OCRed. I just did that because it was faster than digging in the backups.

I am not talking about all eventualities being covered. But to undo a changelog of the last 50 changes should be possible imo.

Depending on the definition of changes. The last fifty keystrokes – probably. The last fifty actions of an arbitrary script – probably not.

Imagine you’d have an AppleScript run inside your smart rule which in turn executes a shell script that sends your files to an external server and then removes them from your disk? How could any software revert that action? Or, closer to your experience, if a script renamed 50 files to the same name by error? How to restore the 50 originals from the single file that remains?

Perhaps a solution would be an option that for any open database, the user could configure a Snapshot or AutoSave of the database every X minutes while retaining Y snapshots. This would be similar to AutoSave in Microsoft Word.

Good idea. On the other hand, databases tend to be a tad bigger than office documents. Which could make taking a snapshot not so “snappy” and risk filling up the harddisk in no time. Also, DT would have to stop doing anything else while taking a snapshot. Stop right in the middle of a smart rule because it’s snapshot time? I wouldn’t want to implement all that transaction handling😉


Would it? Time Machine, Arq, and Apple’s APFS filesystem all do snapshots silently in the background. Windows Servers have a “Volume Shadow Copy” feature which is similar.

Granted maybe those are features so complex that they are best left to the operating system or a freestanding utility.

In fact you could already implement the snapshot feature I am suggesting fairly easily today with Carbon Copy Cloner and/or ChronoSync. Having it integral to DT3 would make it simpler to configure - but it is doable right now with that software.

1 Like