Jump to content

Recommended Posts

Posted (edited)

I am running a large server and ran into a problem of the server's save file being corrupted, so I figured I would document my diagnosis and fix. 
Symptoms

  • New generated chunks being nothing but void
  • /wgen regen generating empty chunks
  • Able to place blocks in empty chunks
  • Can move freely inside empty chunks
  • No error logs in world gen or server main log

Diagnosis steps:

  1. First step I did was check to see if it was chunk corruption or a failure to generate new chunks. I did so by seeing if blocks could be placed inside the chunks that were showing signs of errors
  2. I tested /wgen regen in several already generated older chunks to see if the problem was isolated to the world generation or just the regen command
  3. I started a fresh save file with the same exact mods, configs, and seed to see if the issue was the server backend or a save file issue
  4. After narrowing the issue down to the save file I read this wiki doc to see how the save file is contructed. https://wiki.vintagestory.at/Modding:VCDBS_format
  5. After seeing the different tables and what purpose they serve, I concluded that the MapRegion table was corrupted.

The Fix

  1. Generate back up of server save using:
    Quote

    /genbackup

  2. Stop the server
  3. Rename Default.vcdbs to: oldsave.vcdbs
  4. Generate a new save file with the same mods, configs, and serverconfig. This can be done by starting the server again after changing the name of the save; afterwards stop the server.
    *It is important that if you are changing minor terrain gen that you change it before this step.
  5. Rename the new Default.vcdbs to newsave.vcdbs
  6. Download SQLite3 via terminal command: (I am on a Ubuntu server)
    Quote

    apt install sqlite3

  7. Drag the old save file and the new save file into the same folder 
  8. Run this SQL command:
    sqlite3 oldsave.vcdbs <<'SQL'
    ATTACH DATABASE 'newsave.vcdbs' AS newdb;
    
    DELETE FROM mapregion;
    
    INSERT INTO mapregion (position, data)
    SELECT position, data
    FROM newdb.mapregion;
    
    DETACH DATABASE newdb;
    SQL
  9. You can check if it worked by running:
    sqlite3 oldsave.vcdbs "SELECT COUNT(*) FROM mapregion;"

    It should have a really small number. mine was 16

  10. Delete the new save file as it is no longer needed. It is named "newsave.vcdbs"
  11. Rename the old save file back to: "Default.vcdbs"
  12. Start the server
  13. Run over to the old empty chunks and stand inside them.
  14. Regenerate these chunks using the /wgen regen command

The empty chunks should regenerate as they did before.

Edited by Jack_Frost
forgot a detail and updated info
  • Amazing! 1
  • Jack_Frost changed the title to Clearing world generation data from a save file so it can be changed to accommodate new Watersheds mod 7.0. And how to fix World Generation corruption in a save file.
  • Jack_Frost changed the title to Clearing world generation data from a save file so it can be changed. And how to fix World Generation corruption in a save file.
Posted (edited)
7 hours ago, Jack_Frost said:

I thought I did but I can make another post if that's allowed? I don't want to spam

I say that it's fine.

We don't really have strict admins. who police that type of thing.
(But then again, I'm just some person on a forum.)

P.D.

Edited by Professor Dragon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.