Nimdy / Dedicated_Valheim_Server_Script

Valheim Server Manager . Supports: ValheimPlus, Bepinex, Multi-world, Multi-Lang, Update, Backup, Restore and more: Built for Linux
GNU Affero General Public License v3.0
697 stars 120 forks source link

Progress lost. Can I back up through AWS snapshot? #221

Closed lukasasorensen closed 3 years ago

lukasasorensen commented 3 years ago

I'm a N00b and corrupted my save when I updated without shutting down. I wasn't too worried because I had automatic snapshots set up on AWS lightsail. I tried rollingback to these snapshots and renaming the .old files, but it doesn't seem to work. Are my automatic snapshots useless because I wasn't shutting down the service before those snapshots were created? Any help is greatly appreciated.

Thanks

Nimdy commented 3 years ago

that is strange.

When you update, the services for valheim are stopped and the .db and .fwl have enough time to finish writing. After the update is applied the services are started.

Something else must have been configured incorrectly or permissions were not set correctly.

Additionally, during this last update, I updated all my Valheim installs with zero issues. Half of them had ValheimPlus installed and the other half were vanilla loads.

I would look through your logs and see if we see any errors.

cat /var/log/syslog* | more

cat /var/log/syslog* | grep error

See what errors you see and then go from there.

albinekb commented 3 years ago

I've been bitten by a similar problem. When valheim server is starting, it doens't check if it has write permission to the world file. If you uploaded the save over sftp, it might have the wrong file owner/permissions for the server to write to the file. You can test this by doing something in the world, restarting, and seeing if your updates was saved. It sounds like your server has never written to the world file :/

lukasasorensen commented 3 years ago

I've been bitten by a similar problem. When valheim server is starting, it doens't check if it has write permission to the world file. If you uploaded the save over sftp, it might have the wrong file owner/permissions for the server to write to the file. You can test this by doing something in the world, restarting, and seeing if your updates was saved. It sounds like your server has never written to the world file :/

This sounds like the issue :( I transferred the world save from my computer, and the world didn't reset until after I restarted the server. The world saves are saying that they were last updated on the day I set up the server. I've been running the server since March 3rd... I guess I never thought that it would be saving all that world data in memory.

do you think there is any possibility I could spin up one of my snapshot instances of a few days ago and get the data back? Maybe run a startup script to grab the in memory save somehow?? Unfortunately, I lost ~50hrs of work and my friends work.

Nimdy commented 3 years ago

I am not sure if snapshots restore memory...

Your permissions should look like this:

savedworld https://github.com/Nimdy/Dedicated_Valheim_Server_Script/wiki/How-to-Migrate-Valheim-Map-Data-from-server-to-server

Nimdy commented 3 years ago

If you restore from snap show and get into game and everything is there, check the files and make sure they are correct on the perms

lukasasorensen commented 3 years ago

Yeah. my permissions are definitely wrong. saw the permission denied error in the syslogs as well.. I'm going to try and see if I can start the world when i spin up a fresh instance from a snapshot.

lukasasorensen commented 3 years ago

doesn't seem to work. I think you're right, snapshots do not save memory state. Is it possible that the world was saved to steam cloud?

Thanks so much for your help

Nimdy commented 3 years ago

i dont think that is how it works on dedicated servers.

What did your file permissions look like?

lukasasorensen commented 3 years ago
Screen Shot 2021-03-24 at 10 12 49 AM
Nimdy commented 3 years ago

yeah those are f'd

the walkthroughs say make sure steam is the user and group and it should also be 644 on the settings: -rw-r--r--

Nimdy commented 3 years ago

this is common when people use sudo -u and not sudo -i or not sudo at all

lukasasorensen commented 3 years ago

yeah that's what I thought... RIP my world. at least I took screenshots

Nimdy commented 3 years ago

...that sucks...

at some point... we are all going to have to wipe our worlds....

lukasasorensen commented 3 years ago

yeah... thanks for your help. it is much appreciated. I'll do it right next time 😅

Nimdy commented 3 years ago

let me know if you need help :/