KnowledgebaseProject Zomboid

How to Convert Single-Player Save Data to Multiplayer Save Data and Back

How to Convert Single-Player Save Data to Multiplayer Save Data and Back

Project Zomboid
·
Nov 10, 2024
·
12 min read

When transferring a world between Singleplayer and Multiplayer in Project Zomboid, player data (such as inventory and stats) will not transfer automatically due to differences in how each mode stores data.

If not converted correctly, you may be unable to join your world or experience server crashes. This guide explains how to properly convert player data between formats.

Note

Before proceeding, ensure you have followed the steps in our How to Upload or Download a Save-Game for Your Project Zomboid Server KB guide.


#Key Difference

  • Singleplayer data → stored in /localPlayers
  • Multiplayer data → stored in /networkPlayers

Converting between modes requires transferring data between these tables in the players.db file.


#Converting Singleplayer to Multiplayer

  1. Access your Control Panel and Stop your server.

  2. Upload your Singleplayer world to your server by following our guide here.

  3. Create a workspace folder at any location you'd like on your computer. This isn't required but it will make it easier to work on converting your player data. For this example, we will call this workspace.

  4. Navigate to the Files tab and select the SFTP Connect button to connect via FTP (using either FileZilla or WinSCP).

  5. Navigate to the /Zomboid/Saves/Multiplayer/YOUR_WORLD_NAME directory and download players.db and rename it to oldPlayers.db. Download this file to your workspace folder you created earlier in this guide.


Using the SQLite Database Browser
  1. Download SQLite Database Browser (DB Browser) from https://sqlitebrowser.org/dl/.

  2. Open DB Browser, then click File > Open Database.

  3. Locate the workspace folder you've created, then open oldPlayers.db.

  4. Click Browse Data, then select the localPlayers table. If there's any player data in the table, you can confirm the oldPlayers.db file is using the Singleplayer format.

  5. Delete the players.db file on your server from the FTP directory.

Generate Multiplayer File
  1. Start the server to generate a new file
  2. Join once and create a character, then stop the server
  3. Download the new players.db and rename it to newPlayers.db.
Transfer Player Data
  1. Open DB Browser, then click File > Open Database.

  2. Locate the workspace folder, then open newPlayers.db.

  3. Click Browse Data, then select the networkPlayers table. If there's any player data in the table, you can confirm the newPlayers.db file is using the Multiplayer format.

  4. Open the oldPlayers.db file with DB browser.

  5. Click Browse Data and open the localPlayers table.

  6. Keep a reference of the X, Y, and Z values. Copy and paste this to any note-taking software of your choice.

  7. Right click on the field in the data column for your player and press Copy as SQL. Paste this in the document with your X, Y, and Z values.

  8. Open the newPlayers.db file with DB browser.

  9. Click Execute SQL, then run the SQL command mentioned at the bottom of this Knowledgebase article. Replace the values in the SQL command with the values you've taken note of previously. You will want to modify the networkPlayers table.

  10. Click the Execute all/selected SQL button. This looks like a play button and is located near the top left of DB Browser.

  11. Click Browse Data and confirm the changes were applied.

  12. Press the File button, then click Write Changes and Save All. Exit DB Browser.

  13. Navigate to your workspace folder and rename newPlayers.db to players.db

  14. Upload the newly renamed players.db file to /Zomboid/Saves/Multiplayer/YOUR_WORLD_NAME.

  15. Start your server and connect to join with your Singleplayer character data.


#How to Convert Your Multiplayer World to Singleplayer

  1. Access your Control Panel and Stop your server.

  2. Download your world by following our guide here.

  3. Make sure you've replaced the players.db file as mentioned in the previous Knowledgebase guide.

  4. Create a workspace folder at any location you'd like on your computer. This isn't required but it will make it easier to work on converting your player data.

  5. Navigate to the location you've downloaded your world to in your Project Zomboid game directory.

  6. Locate the players.db file that contains your multiplayer player data to the workspace folder you've created. You can find this directly on your server in the world directory.

  7. Move the players.db file to the workspace folder you've created, then rename this to oldPlayers.db.

  8. Download SQLite Database Browser (DB Browser) from https://sqlitebrowser.org/dl/.

  9. Open DB Browser, then click File > Open Database.

  10. Locate the workspace folder you've created, then open oldPlayers.db.

  11. Click Browse Data, then select the networkPlayers table. If there's any player data in the table, you can confirm the oldPlayers.db file is using the Multiplayer format.

  12. In the networkPlayers table, keep a reference of the X, Y, and Z values. Copy and paste this to any note-taking software of your choice.

  13. Right click on the field in the data column for your player and press Copy as SQL. Paste this in the document with your X, Y, and Z values.

  14. Open the players.db file located in the Project Zomboid game directory with DB Browser. This would be the world folder on your computer located under C:/Users/YOUR_USERNAME/Zomboid/Saves.

  15. Click Execute SQL, then run the SQL command mentioned at the bottom of this Knowledgebase article. Replace the values in the SQL command with the values you've taken note of previously. You will want to modify the localPlayers table.

  16. Click the Execute all/selected SQL button. This looks like a play button and is located near the top left of DB Browser.

  17. Click Browse Data and confirm the changes were applied.

  18. Press the File button, then click Write Changes and Save All. Exit DB Browser.

  19. Start Project Zomboid on your computer, then press the LOAD button.

  20. Select the world you've just uploaded and press PLAY.


#SQL Command Cheatsheet

When running the command, replace the text REPLACE_WITH_TABLE with the table you're updating.

If you're converting your world from singleplayer to multiplayer, the table you will be modifying is networkPlayers.

If you're converting your world from multiplayer to singleplayer, the table you will be modifying is localPlayers.

You can find the full command below. Don't forget to replace all values indicated in the comments!

-- Update player data
UPDATE "main"."REPLACE_WITH_TABLE" -- Select which table you'd like to modify.
SET data = NULL -- Replace “NULL” with value inside the copied SQL command VALUES(); method
WHERE id = 1; -- The ID is the row you're replacing the value of for the character you created earlier.
-- Update player X coord
UPDATE "main"."REPLACE_WITH_TABLE" -- Select which table you'd like to modify.
SET x = 0 -- Replace with the X coordinate of the player.
WHERE id = 1; -- The ID is the row you're replacing the value of for the character you created.
-- Update player Y coord
UPDATE "main"."REPLACE_WITH_TABLE" -- Select which table you'd like to modify.
SET y = 0 -- Replace with the Y coordinate of the player.
WHERE id = 1; -- The ID is the row you're replacing the value of for the character you created.

-- Update player Z coord
UPDATE "main"."REPLACE_WITH_TABLE" -- Select which table you'd like to modify.
SET z = 0 -- Replace with the Z coordinate of the player.
WHERE id = 1; -- The ID is the row you're replacing the value of for the character you created.

If you require any further assistance, please contact our support at: https://shockbyte.com/billing/submitticket.php

Join Discord