Skip to content

Instantly share code, notes, and snippets.

@mojobojo
Last active February 17, 2024 10:18
Show Gist options
  • Save mojobojo/c9e1e3d05d074408ed4bd6fbe04e62ef to your computer and use it in GitHub Desktop.
Save mojobojo/c9e1e3d05d074408ed4bd6fbe04e62ef to your computer and use it in GitHub Desktop.
Explanation on how to manually repair your servers save files when your server decides to change everyones user id.

Disclaimer

I am not responisble for any corrupted or lost data. This worked for me, it may not work for you. With that said, this is a VERY manual process at the moment. With this process I successfully restored my guilds characters, levels, and guild assocation along with the guild leader as if nothing had happend.

Preperation

Tools I Used

Backup your save files

Shut down your server and make a backup right now! We will need these files for later. I cannot stress this enough, please keep frequent backups. image

Getting new player IDs

After you backup your saves you will have to get your players to reconnect and make new characters. I suggest asking each player one-at-a-time and watching as each save file appears for them and saving each .sav file with a note for each one documenting who is who. If you cannot do this because you do not have easy contact with your players, then you will have to get the ID associations with each name from the Level.sav file after everyone logs in and makes a new character. image

Getting ready to use the palworld-save-tools

Download the palworld-save-tools and extract it somwhere. Open up CMD using hitting the windows key then typing cmd and hitting enter.

image

Once CMD is open, type this command to switch to the directory you downloaded to.

cd C:\Path\To\palworld-save-tools

A little side note, if your download resides on a drive that is not the C drive like for me I used the E drive, you need to switch to that drive by typing this into CMD either before or after the previous command.

E:

Alternativley (this is my preferred method) is to just right click inside your folder you want to CMD in and click "Open In Terminal".

image

The Fixing Process

Fixing your player save files

Copy both your new and old player save files over to the palworld-save-tools directory. Then for each for each of your player save files you will use the command.

python convert-single-sav-to-json.py .\uesave\uesave.exe PLAYERID.sav

image

After you do each of your players, your folder should be filled with json files now. image

So by now you should have a list of each players old sav file and new sav file. Open both your old PLAYERID.sav.json and new PLAYERID.sav.json in Visual Studio Code, from there you will scroll down until you find these lines.

image

On the left is the old player profile, on the right is the players new profile. Now the two GUIDs here are important to remember. Keep these IDs safe for later, you will need them to restore your levels and guild information!

In the file on the left:

  • cf88b114-0000-0000-0000-000000000000
  • b25f0602-4a53-5975-81df-f29b00c04361

In the file on the right

  • f3972d82-0000-0000-0000-000000000000
  • cc9964d7-426b-b774-7857-cc8409d5487f

The file on the left is the one we will be editing. Now you will be replacing the new IDs over the old IDs like so

image

We are done editing this file. Now we can turn it back into a sav file by doing this command.

python convert-single-json-to-sav.py .\uesave\uesave.exe PLAYERID.sav.json

image

Last you need to rename the .sav file you just made to your new player id or else it will not load. In my case I will rename CF88B114000000000000000000000000.sav to F3972D82000000000000000000000000.sav. After you do that, copy the new .sav file to your Players Folder.

image

Now do this for every player, im sorry for those that have a lot of players on their server!

Fixing your Level.sav file

Buckle up because this one is kinda janky due to text editors not dealing with large files well. Be aware you will need a decent amount of ram to do this as the extrator used about 10gb of ram on my pc while creating the levels json data. This will vary depending on the size of your world.

First we need to convert our Level.sav to a json with this command.

This will take a while and output a large file be patient

python convert-single-sav-to-json.py .\uesave\uesave.exe Level.sav

image

You will have an output file that looks like this image

Next you will be opening this file with HxD.

Note: I would love to use a real text editor but couldnt not manage to get one to handle large files.... This is the alternative I used.

image

Now we want to go to Search->Replace

image

From there we want to click on "Replace All" old IDs with the new ones.

The first ID replace should look like this

image image

The second ID replace should look like this

image image

Do this for each of your players, save, and you are done with HxD.

The last step is to convert your Level.sav.json back to a sav file using this command.

python convert-single-json-to-sav.py .\uesave\uesave.exe Level.sav.json

image

Once again, this will take a while and use a lot of ram, be patient.

When this is done, your new Level.sav file is there, ready to copy over to your server folder.

image

If all goes well, everything should be back to normal.

Hopefully I explained this well, let me know if there are any corrections or any new developments about the save file problem.

@mojobojo
Copy link
Author

Hi! Thanks for your work. It worked for me. I also tried to automate this in the following script, if it can help anyone: https://github.com/Matheo-Moinet/palworld-server-save-transfer

That is pretty cool! Automating this process was something I considered but never got around to it. Glad to see someone do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment