Skip to content

Fastest backup for SuperMemo

February 21, 2010

If you’ve being reading my previous posts, you know I’ve been quite concerned about having backups as fast as possible of my collections and also that this backup process would be done with the less steps involved. This is not some unworthy goal of mine, in fact it is despicable that supermemo doesn’t come with a descent backup option, the argue that they are on the business of Spaced Repetition algorithms not backups, shame on them.

Many change of behavior or search for solutions come only after a painful learning experience, and mine was too. I lost a full long weekend of importing and organizing 3000+ scanned questions banks on USMLE for not having an updated backup. Is not that forgot you should always backup your collections, the problem lies that even drag and dropping into Winrar takes more than 15 minutes once your collection builds up to 100,000+ files (Duocore 2.1Ghz 320Gb HDD). So that day, I deferred the backup until the work was finished, but thanks to a mistake while moving items, finishing would come a whole two nights later, after I restarted from scratch.

Always remember to backup

If they keep providing the best SRS available I can still let go their neglecting on the backups issue, but I still scorn that they don’t include a Topic of improving the GUI (pun intended).

Yesterday, I finalized a week of testing the script for making this almost as I dream of, if you don’t like the finished product, you’ll probably also not enjoy my dreams. Anyhow, who should enjoy the most about his own dreams?. The small program you can download bellow is the same one I’m using.

A SuperMemo 2006 and a SuperMemo 2008 version as well is provided. I’ve never used for a long time any other version and only tested them to see if the newer one’s have been deprived of some useful functionally.

If you don’t need to process images incrementally, automatic labeling of imported documents (only if the imported articles comes trough IE), or optimization of learning by your sleep patterns (only if you register every night sleep start and end time, while never resisting sleep even if you’re really tired, as well as avoiding taking a midnight latte, or two, to combat the highest forces of Morpheus for tomorrow’s exam, presentation or simply not getting enough sleep because you’re in party that night), then probably SuperMemo 2006 is a better option for you, in fact I would even recommenced it over SuperMemo 2008 in that case.

Back to main point of this post: SMBackup, my fastest method for backups of  SuperMemo’s collections

This app does only two things

1) Double click on SMbackup.exe loads your current SuperMemo

2) After quitting SuperMemo it starts up a console window with options for a Full or incremental backup.

The installation process was intended to be the easiest one, so there is no installation procedure. Just unzip the downloaded file and then copy its full contents to the same folder where sm2008 or sm2006.exe is (normally SMbackup.exe and 7za folder should be on c:\supermemo)

After the backup process it creates two folders, LastBackup and OldBackup from where you can restore your collection when needed.

To restore you’re collection you’ll need 7zip or Winrar for now, I will probably include the option to restore from the same app later on, currently I use Winrar contextual menu at home and portable 7zip every where else.

First Full backup will probably take a long time albeit far faster then original supermemo option. Also first incremental backup is slowest than subsequent backups on the same windows session (I use SuperMemo on small packs of time). This might give you and idea on the performance of this small app, but is better to test it out.

Synchronization part II is still being incubated, as I’m probably testing out Live Mesh instead of  Dropbox, and part II was intended to be about synchronizing on a stick not online, so I guess that should meand a part III will also be needed.

If you’re a bit confuse with all my pro and cons comments about SuperMemo, I must emphasize that its always been a bitter sweet, love and hate, relationship with this program. But can’t deny  I’m “still” in love with it. Although Evernote and the like are great apps my external hypocampus has become my commonplace too. Hmm… that would probably means it ain’t only a hypocampus no more, but a full fledged neocortex update for my brain.


SMBackup for sm2008

SMBackup for sm2006 (2010.03.02: SMBackup for 2006 has been updated thanks to protestantCZ. 2010.03.27 readme.txt fixed)

22 Comments leave one →
  1. February 21, 2010 13:30

    The Dropbox solution in your previous post (on synchronizing 2 computers) also provides a backup solution, right?

  2. gersapa permalink*
    February 21, 2010 14:11

    Yes and No Jerry. Your suggestion is in deed one on the easiest to implement and probably suited to most people.

    Worst case scenario you would have to copy the latest un-sync collection from one of the other computers where you have Dropbox on (I have it at office and home desktops).

    From another point of you, Dropbox files are modified almost instantly once you sync. Of course Dropbox saves any version of your files (up to 30 days in free version, or infinitely paid version) but it takes a lot to guessing which of the modified files are the necessary to restore your collection to a certain date or time, so that leaves restoring individual files out of the question.

    Because of the number of files on SM collections, this backup provides the fastest way to copy an updated version of the all the collection. You could use Teracopy but for me even that takes 45 minutes to copy mines to a USB, although this is great compared to direct copy more then 6 hours task.

    As the backup done by 7zip checks only for the changes since last zip operation; then, no matter how big your collection is, this doesn’t slow down the updates done with SMbackup, in fact it takes me less then 20 seconds normally and up to 1.5 minutes if it is the first backup of the day.

    Many people, using SuperMemo, have suggested using 7zip. This is how I learned about it, but I wanted a more automated solution. Mine is SMbackup.

    So I guess it always comes down to individual quirks and preferences. Hope you enjoyed the comic, so much as I did.

  3. Anonymous permalink
    February 22, 2010 04:48

    Good day gersapa. It seems like the link for SMBackup 06 is wrong. I downloaded the SMbackup 2006 version but in the file it says that it is for SM 2008. I also tried using it but it also says it is for SM08 and doesn’t run SM by itself.

    • gersapa permalink*
      March 27, 2010 15:37

      I’ve reviewed SMbackup for sm2006 and it works ok, make sure above stated files are on the same folder as sm2006.exe (normally it would be c:\supermemo), not inside another folder,

  4. Alex permalink
    February 22, 2010 19:41

    I’ve been trying to do incremental backups for a while. I’m glad there seems to be a tool that does the job quickly.

    Assuming this tool makes an incremental backup (Update) – one question: Does the 7zip incremental backup take care of files that have been deleted (say, deleted elements)? (e.g. by removing them from the latest backup) Also: could you please provide the command parameters passed to 7z.exe? I’m particularly concerned about the options passed to the -u (Update options) switch, if any.

    Thanks for providing this quick solution.

    PS: SMback 2006 v.0.46 readme file still refers to SM 2008.

    • gersapa permalink*
      March 27, 2010 15:41

      Sorry for not answering this comment for so long, I guilty of not reviewing the spam folder in wordpress. Readme file was wrong, but is fixed now. on SMbackup 0.47.1. Non other mistakes were found.

      Make sure sm2006 and provides 7za folder as well as smbackup.exe are on the same folder.

  5. protestantCZ permalink
    March 2, 2010 05:42

    I downloaded version for SM 2006, but it didn’t work. In readme.txt is written, that it’s for SM 2008.

    • gersapa permalink*
      March 2, 2010 06:19

      Thank for the feedback. I mus admit it was not just some typo. version SMBackup 0.46 for 2006 would open 2008. This has been fixed and uploaded new version. Make sure 7za folder and SMbackup.exe are on the same folder as sm2006.exe

      Feel free to ask again if you have any problems.

  6. protestantCZ permalink
    March 2, 2010 07:27

    All is now OK.

  7. mndfll permalink
    March 5, 2010 08:45

    Fast and thorough: thank you! The only little hitch I had was making sure the .exe program was in the same folder as SM2008.exe. You have really helped us all.

  8. Marcin Rybacki permalink
    March 5, 2010 14:09

    Could you include source code of those two programs? I would like to have a look at them before I start using it 🙂

  9. gersapa permalink*
    March 7, 2010 09:04

    Sure, under a NDA, lol. I don’t like to much technical information on the posts – I must admit some times this ruled is bend a lot though.

    It’s my intention to post all script and source code related to learning with SRSs on ad hoc page as soon as my GTD lets me do it.

    In SMbackup it all come down to a single batch file compiled in to an exe, using bat to exe.

    Good luck!

  10. Brad Isaac permalink
    March 24, 2010 10:18

    Why do you want to open SM before backing it up? It goes contrary to most backup strategies.

    • gersapa permalink*
      March 25, 2010 09:55

      Your totally correct on this one, but I don’t open SuperMemo to do the backup procedure, but to do the repetitions, and then the backup window is launched right after I close SupeMemo to forbid me forgetting to backup.

  11. Alexander Laertes permalink
    March 24, 2010 21:47

    Before running this I would like to know more about the switches passed to 7z. Are you passing the -uq3 switch to 7z’s update command?

    7-zip’s u command without any update switches will update an archive by replacing existing files with newer copies and adding non-existent files, but will keep files in the archive that were removed on disk, whereas 7-zip’s u command plus the -uq3 switch will also delete files from the archive if they were deleted from disk, which is a more accurate reflection of the state of the world for the collection (esp. if you frequently delete elements). I understand that this is not what everybody would want to do, however.

    • Alexander Laertes permalink
      March 24, 2010 22:26

      On a second thought, -uq3 will create an anti-item in the archive that will delete the file upon extraction (-t7z is assumed). In the event this file is recreated on disk with the same name, it will only be updated in the backup archive if its date is newer than the date of the backup archive, unless e.g. it is explicitly copied with -uq3x2. It looks OK, but I suppose there could be a more elegant solution.

      • gersapa permalink*
        March 25, 2010 10:13

        You concerns are quite important, 7zip has a lot of helpful switches I haven’t found in other compression software this powerfull (if only it had recovery error functionality, but the world is not perfect right?), switches are a lot cumbersome to most, hence I thought it would be better to hide the non essential details on the post. I intend to post complete source codes on another page along with the rest of currently used autohotkey scripts (I takes me a lot to organize it that’s all). In the mean while, the switches used in SMbackup are the following.



        twitter source:
        aucelum method is:

        aucelum14 mins Backing up supermemo collections with: 7z.exe -pmypassword -mhe -t7z -mx=0 u CollName.7z CollName CollName.Kno -uq3x2 > CollName.log

        As you can see it lacks some switches used in SMbackup, mx=0 is the fastest but you achieve no compression, using mx=1 gives you some compression but does make a difference, I do use the password option in my personal SMbackup, but it’s included in the compiled encrypted version. I use batch parsing for date and time, because I’d like to have several backups, sometimes you figure out some mistake only when you’ve already done a lot of repetitions, and having several backups helps you recover this kind of mistakes.

        Id like to know what you think about this approach, should something be done differently? perhaps SMbackup needs a new version already.

        • Alexander Laertes permalink
          March 26, 2010 00:08

          Thanks for providing the switches. Yes, I did notice a case not covered (-uw2), which I’m going to adopt immediately. The other update switches I assume default behavior (I’m talking about -ur2y2), but…they should be specified.

          I didn’t consider compression (speed and integrity are paramount to me) so I didn’t use other -m switches. However, I was surprised to notice that -ms=off wasn’t default behavior! Solid archives plus compression hold back the update process when updating a large quantity of files. I overlooked it, as well as -ssx – due to IE8’s quirks and SM06’s treatment, I frequently edit the HTML source of elements; I may close SM, but keep the file open in an editor, only to find that by not specifying this switch it might not update.

          In short, I would not change anything. I would only like to know the rationale behind:

          1. -up3 in both methods

          2. -uz1 in the update method

          (perhaps it’s obvious, but I’m tired).

          Also, time-stamping backups (and having ~3 of them at any one time) is a good practice.

        • gersapa permalink*
          March 26, 2010 08:59

          Can be obviated , no need in this case as the program 7zips the complete SuperMemo-system folder, hence no wild-cards are used.

          -z1 or -z0

          z1 is used on Full backup, and z0 on Update (both sets of switches update previous archives). Previous comment regarding the order of the update or full set of switches was wrong before (now updated). I also include a -u- in a update version. This makes a smaller archive for the update version, which is automatically loaded into my dropbox, this is the main concern of having full or update version of the backups, but it also adds up to a faster process as in update “z0” copies no files that are already included in previous full backup.

          I liked aucelum’s using CollName and CollName.kno on a single statement, for DIY’s using a batch file for any collection is great.

        • Alexander Laertes permalink
          March 26, 2010 09:32

          I meant to ask:

          2. -uz1 in the full method

          After a night’s sleep, I get it.

          This is very useful material for writing a batch file to perform automatic backups.

  12. mndfll permalink
    February 22, 2013 17:01

    I was able to make a Supermemo15 back up using the backup for SM2008 by chaning the name of SM15.exe to SM2008.exe. I got a couple of error messages from SM, but the backup seems to have gone smoothly. Any chance for a script update? Thanks

  13. October 4, 2014 14:06

    A fascinating discussion is worth comment. I believe that you should write more
    about this issue, it may not be a taboo subject but generally people do not speak about these issues.
    To the next! Best wishes!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: