How to disable backup feature

Hi,

Since I use Anki 23.10.X and onwards the backup dialog gets frozen and I can no longer use Anki unless I kill the process and start again. I am not sure how to trigger the issue exactly. I know that having the browser window open for a while seems to be a requirement.

Rather than identifying the hard-to-reproduce bug, I would like to ask how can I disable backups to begin with. Seems that it’s a setting that cannot be disabled. I made an add-on for that matter which I used for 3 years, but it broke with 23.X update. My two collections are large and the backups while using Anki are a complete nightmare. I do the backups on command while not using Anki.

1 Like

It’s not possible to completely disable backups. Can you reproduce the problem in 23.12? Can you reproduce it with add-ons disabled?

I cannot reproduce the issue after some useage with no add-ons. I installed no add-ons in a while, even before updating Anki. So I am afraid some add-on is causing this after updating. I disabled all add-ons related to backups before writting here.

I will be renabeling add-ons one by one to indentify which one is causing the issue.

At any rate, I would like to update my add-on to disable the backup from triggering. I remember it was straight to do with monkey patching but I lost familiarity with the code base for some years. a guidance which function to patch or hook to use will be apreciated.

I finally found the add-on causing the issue, turns out is actually the last add-on I installed: Grid fields from @abdo (not the one from ankiweb)

Abdo, if its not too time-consuming, could you check it out? When the backup triggers Anki freezes. That happens when the browser window is open (and I guess the add-on is active as it only works on the browser window). Having the browser window open for long increases the likehood of triggering the issue. I usually check ChagtGPT to explain sentences and then generate some images so this process is a good way to try reproducing it.

All Anki 23.X versions I used had this issue. Not 100% of the times, but most of the time. Enough to kill Anki process several times per hour.

Hmm, I can’t think of anything in the add-on that could cause this. It’s a pretty typical editor add-on, and doesn’t do any long-running operations that could block backups. Can you try running Anki from the console and see if you get any interesting output when the issue occurs?

I triggered the issue a few times a day without your add-on. At least I can say it happens a lot more frequently when running grid fields. I am still unsure what is the real cause. By the way, could you lead me to which methods to monkey patch to disable backups? I think that would be easier to achieve.

This should work:

from anki.collection import Collection


def do_nothing(*args, **kwargs):
    pass


Collection.create_backup = do_nothing

It disables all backups. Even File > Create Backup won’t work. It’s not possible to selectively disable periodic backups.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.