RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    List of game save file extensions?

    Scheduled Pinned Locked Moved Help and Support
    backupgame savesextensionssave file
    18 Posts 8 Posters 9.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lordcrammy
      last edited by

      Does anyone happen to know the extensions that each emulator uses for the in-game save files?

      I'm trying to get a script to run that will search the ROM folders and subfolders and copy all the save game files and the .state files over to a USB and maintain the same folder structure. I'm using it as a backup in case I ever have to restore RetroPie

      meleuM 1 Reply Last reply Reply Quote 0
      • meleuM
        meleu @lordcrammy
        last edited by

        @lordcrammy said in List of game save file extensions?:

        Does anyone happen to know the extensions that each emulator uses for the in-game save files?

        I know that the .srm is the one used for RetroArch NES and SNES cores. But I'm not sure if this is the same for every core.

        • Useful topics
        • joystick-selection tool
        • rpie-art tool
        • achievements I made
        1 Reply Last reply Reply Quote 0
        • B
          bobcat987
          last edited by bobcat987

          The '.srm' and '.state[0-9]*' files are the two formats of state files in my experience. I backup with:
          find /home/pi/RetroPie/roms/ -name "*.srm" -o -name "*.state*" | tar --transform 's|/home/pi/||g' -PcJf retropie_saves.tar.xz -T -

          To restore, run the following:
          tar -C /home/pi -xJf retropie_saves.tar.xz

          You could probably do something like the following to backup to to usb in the way you describe:
          find /home/pi/RetroPie/roms/ -name "*.srm" -o -name "*.state*" | tar --transform 's|/home/pi/||g' -Pcf - -T - | tar -C <path_to_usb_root>/<backup_dir> -xf -

          1 Reply Last reply Reply Quote 1
          • L
            lordcrammy
            last edited by

            Thanks for the responses!

            I also found this command before you replied:

            find . -name "*.srm" | xargs cp --parents -t /media/(name of usb)/
            

            But that only included the one filetype. I'm very new to Linux. It worked on some empty files i created, but I didn't find a good way to restore them. i was probably just going to copy them over via SFTP if i had to re-image the SD card.

            I also found this thread: https://retropie.org.uk/forum/topic/2370/is-it-possible-to-call-an-retropie-setup-scriptmodule-from-command-line

            I want to incorporate the backup script in the Retropie menu if possible.

            1 Reply Last reply Reply Quote 0
            • L
              lordcrammy
              last edited by

              I want to create a menu selection under the RetroPie menu to run the save file backup. Here is what I'm thinking may work:

              • create an empty .rp file called gavesave-backup.rp under /home/pi/RetroPie/retropiemenu
              • create an icon and call it gsbackup.png and save it under ~/RetroPie/retropiemenu/icons/
              • create an entry in the gamelist.xml file under /home/pi/RetroPie-Setup/scriptmodules/supplementary/retropiemenu/ directory with:
                  <game>
                      <path>./gamesave-backup.rp</path>
                      <name>Gamesave Backup</name>
                      <desc>Create a backup of all your games savefiles and save states and export them to a USB stick.</desc>
                      <image>~/RetroPie/retropiemenu/icons/gsbackup.png</image>
                  </game>
              
              • create a SH script named gamesave-backup.sh under /home/pi/RetroPie-Setup/scriptmodules/supplementary/ with one of the lines from previous replies, but also add ".dat" for CaveStory gamesaves. For example:
              #!/bin/bash
              find . -name "*.srm" -o -name "*.state*" -o -name "*.dat" | xargs cp --parents -t /media/(name of USB drive)/
              

              So once all that is done, it should hopefully run from the menu. I have a few concerns though. Will it run and come back to the RetroPie menu? Will it just go to a black screen and not come back? What will happen if someone runs it without having the USB plugged in, or puts in another USB that doesn't have the name listed in the SH file?

              Can anyone check this or give me some clarification?

              1 Reply Last reply Reply Quote 1
              • dankcushionsD
                dankcushions Global Moderator
                last edited by

                .nv, .hi, .hs, .cfg and probably others are used by mame/fba.

                for me, this is why https://github.com/RetroPie/RetroPie-Setup/wiki/Running-ROMs-from-a-USB-drive is the way forward. if i want to backup my roms/saves i just take the stick out and copy the whole thing to my computer, and i get everything.

                1 Reply Last reply Reply Quote 0
                • L
                  lordcrammy
                  last edited by

                  Thanks for the extra info. The reason i want to make a menu entry to automate the backup is I'm putting a few RetroPies together as Xmas gifts for friends. They are not savvy enough to do backups manually, so i want it to be idiotproof, just put in a USB stick, run the menu command, done.

                  If they ever make the SD corrupt, i'll just reimage the card and copy their save files back over.

                  1 Reply Last reply Reply Quote 0
                  • L
                    lordcrammy
                    last edited by

                    How about DOSBox game saves and ScummVM? Do they have different save file extensions?

                    1 Reply Last reply Reply Quote 0
                    • flopF
                      flop
                      last edited by flop

                      ".EEP" for N64
                      ".SRM" for SNES and too GBA

                      Hmm, the idea it´s pretty good, maybe to save the highscores from Arcade too?

                      1 Reply Last reply Reply Quote 0
                      • L
                        lordcrammy
                        last edited by lordcrammy

                        High scores would be cool. My RetroPie doesn't have MAME installed, but I have NeoGeo. I have no idea what files would contain that data for either though, unless like stated by dankcushions, maybe the .HS files?

                        dankcushionsD 1 Reply Last reply Reply Quote 0
                        • dankcushionsD
                          dankcushions Global Moderator @lordcrammy
                          last edited by

                          @lordcrammy i use lr-fbalpha and it looks like it keeps .fs files for neogeo saves.

                          1 Reply Last reply Reply Quote 0
                          • L
                            lordcrammy
                            last edited by

                            i put RetroPie on another SD card so i could experiment with it without ruining what I have on my other SD. i tried doing what I listed at the top of this thread. I received a few errors.

                            First:
                            cp: failed to access /media/4GB/: no such file or directory

                            (4GB was the name I gave the USB stick)
                            Then I got the next 2 lines:
                            Module /home/pi/RetroPie-Setup/scriptmodules/supplementary/gamesave-backup.sh is missing valid rp_module_id
                            Module /home/pi/RetroPie-Setup/scriptmodules/supplementary/gamesave-backup.sh is missing valid rp_module_desc

                            Any idea which file contains the spots I'd have to give it the ID and Description? I think I might have fixed the USB location issue by mounting the SDA1 to /media/usb, but I still need to correct the last 2 errors.

                            1 Reply Last reply Reply Quote 0
                            • L
                              lordcrammy
                              last edited by

                              I have temporarily given up on creating a menu selection to do a backup of the save files. Instead, I've copied an SH file to the /home/pi directory called "backup.sh". I will just show them how to plug in a USB keyboard, hit F4, then run the command to start the script after plugging a USB stick in. So basically:

                              sudo sh /home/pi/backup.sh
                              

                              The contents of the SH file are as follows:

                              #!/bin/bash
                              sudo mount /dev/sda1 /media/usb0
                              find . -name "*.srm" -o -name "*.state" -o -name "*.dat" -o -name "*.nv" -o -name "*.hi" -o -name "*.hs" -o -name "*.cfg" -o -name "*.fs" -o -name "*.eep" -print0 | sudo xargs -0 cp --parents -t /media/usb0/
                              sudo umount /media/usb0
                              

                              I know it's very long, but I don't know how to condense the extensions into one easier command, I'm very new to Linux. The backup does work though, I tried it myself, everything gets copied over into the same tree structure as on the Pie. The "-print0" entry before the pipe and the "-0" after "xargs" had to be put in to list the files before copying them because most of the ROMs have spaces in the names, and if you don't put it there, you get a bunch of STAT errors where the command breaks down each word in the ROM name as a file and it fails.

                              The only thing I have to mention is that I had to do:

                              sudo chmod 777 /media/usb0
                              

                              before running the script (but after plugging in the USB stick) or you get write permission errors.

                              If anyone else has any input, it would be appreciated. Or if you know of any other save file extensions. Otherwise, I may mark this as solved in the next few days.

                              B 1 Reply Last reply Reply Quote 1
                              • B
                                backstander @lordcrammy
                                last edited by backstander

                                @lordcrammy
                                Great script!

                                I'm not at my Pi to test this but you might back able to add this to the EmulationStation Ports menu like this:
                                nano /home/pi/RetroPie/roms/ports/Backup\ Savegame\ Files.sh
                                Or some name that makes since and then put your same script in there!

                                And, yes, make sure it's executable:
                                chmod +x /home/pi/RetroPie/roms/ports/Backup\ Savegame\ Files.sh

                                So under the Ports menu it should have "Backup Savegame Files" or whatever you called it.
                                Also for the .sh using 777 would work but it would be more secure if you used 755 instead but this shouldn't matter on the Pi lol
                                I personally like to just do the +x which just makes it executable to everyone and keeping everything else the same.
                                For the /media/usb0 it might be better to use the 777

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  lordcrammy @backstander
                                  last edited by

                                  @backstander Hey that's a good idea actually. I'll give it a try in the next few days, work has me busy these next few evenings. I'll let you know how it works for me.

                                  Also, yes i know 777 isn't the best choice for most things, but this is just the USB stick, so i don't really mind having full rights to it.

                                  1 Reply Last reply Reply Quote 1
                                  • F
                                    FreakyBigFoot
                                    last edited by

                                    If you guys are interested I made a tool to backup saves to Dropbox. You can check it out here: http://www.freakybigfoot.com/pisave.php

                                    D 1 Reply Last reply Reply Quote 0
                                    • D
                                      Dochartaigh @FreakyBigFoot
                                      last edited by

                                      I also find it's nearly as easy to simply have all your save games go into 1 consolidated directory. Takes me about 10 seconds to SSH into my Pi with an FTP client and drag that file over for backup.

                                      1 Reply Last reply Reply Quote 0
                                      • F
                                        FreakyBigFoot
                                        last edited by

                                        Oh for sure! This is just nice to be able to hit a button and let it do it's thing. It will be the same to restore soon.

                                        1 Reply Last reply Reply Quote 0
                                        • First post
                                          Last post

                                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.