TheSudoYT / terraform-aws-palworld

Terraform module for Palworld Server Infrastructure on AWS
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

How do I restore from S3 backup? #10

Open rubix2024 opened 5 months ago

rubix2024 commented 5 months ago

Hi there! Hacker came into my server and started trolling wiping people's bases out.

How do I replace the worldsettings.ini file, and the level.sav and player folder with the backups in S3?

Josh-Tracy commented 5 months ago

Sorry this happened to you.

If you were using the enable_s3_backups = true option and have the backups in S3 then you have 3 options for restoring.

Option 1 is to download the backup files to your local PC. After you have the backup files, run a terraform destroy to destroy the server. Then you can add the input start_from_backup = true along with backup_files_storage_type = "local" and backup_files_local_path = "path/to/backup/files/on/my/pc" and dedicated_server_name_hash = "this is the value for DedicatedserverName in GameUserSettings.ini" See the README instructions for the required file structure.

Option 2 is to again download the backup files to your local PC, but then manually create your own S3 bucket and provide the following inputs:

start_from_backup = true
dedicated_server_name_hash = "this is the value for DedicatedserverName in GameUserSettings.ini"
backup_files_storage_type = "s3"
existing_backup_files_bootstrap_bucket_arn = " the arn of your bucket"
existing_backup_files_bootstrap_bucket_name = "the name of your bucket"

You can get the ARN of your bucket by clicking on it and viewing its properties

Option 3 is to download the backup files from S3 to your local PC, and then use the SCP command to copy the files to the ec2 instance remotely. Here is the process to do so:

sudo systemctl stop palworld sudo tar -czvf palworld_backup.tar.gz /palworld-server/Pal/Saved/SaveGame

sudo chown ubuntu:ubuntu palworld_backup.tar.gz

scp -i /path/to/your-key.pem ubuntu@your-ec2-public-ip:/path/to/palworld_backup.tar.gz C:/local/destination/path

systemctl start palworld