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 to get the backup of dedicated server save file on S3? can you guide me? #18

Open ridwanaliah opened 4 months ago

ridwanaliah commented 4 months ago

Hello The Sudo,

I have enabled the backup s3 modules image

but why i still dont get the backup file on s3? image

it says: No object found can you help me? thank you, sir.

Josh-Tracy commented 4 months ago

What version of the module are you using and what AWS region are you in.

Josh-Tracy commented 4 months ago

@ridwanaliah also, set the backup_s3_bucket_arn = "" and backup_s3_bucket_name = "". Those inputs are only used when you have create_backup_s3_bucket = false because you have an existing S3 bucket you want to use.

ridwanaliah commented 4 months ago

What version of the module are you using and what AWS region are you in.

i used the sudo 1.1.0, my region ap-southeast-1

ridwanaliah commented 4 months ago

@ridwanaliah also, set the backup_s3_bucket_arn = "" and backup_s3_bucket_name = "". Those inputs are only used when you have create_backup_s3_bucket = false because you have an existing S3 bucket you want to use.

okay i'll try it now

image

PS: I have changed it to your advice, and now i'm waiting for the backup files

Josh-Tracy commented 4 months ago

Version 1.1.1 includes a bug fix to support certain AWS regions with s3. If the palworld_backup_log.txt file in the /palworld-server directory says something like this:

An error occurred (IllegalLocationConstraintException) when calling the PutObject operation: The ap-southeast-1 location constraint is incompatible for the region specific endpoint this request was sent to.

Then you need to update the module version to 1.1.1 and do one of these 2 options:

Option 1

Delete your server and rerun terraform apply to get a new server with the new user_data script. This will build a new /palworld-server/palworld_backup_script.sh on your server with the fix applied.

Option 2

SSH into your server and edit the existing backup script located in /palworld-server/palworld_backup_script.sh and look for these lines:

aws s3 cp "\$BACKUP_FILENAME" s3://"\$S3_BUCKET_NAME"/ 
aws s3 cp "\$GUS_BACKUP" s3://"\$S3_BUCKET_NAME"/ 

and add --region af-south-1 to the end of both of them. Example:

aws s3 cp "\$BACKUP_FILENAME" s3://"\$S3_BUCKET_NAME"/ --region ap-southeast-1
aws s3 cp "\$GUS_BACKUP" s3://"\$S3_BUCKET_NAME"/ --region  ap-southeast-1
ridwanaliah commented 4 months ago

Can you give me some instruction how to update to 1.1.1 module?

anyway i still don't get any backup files

ridwanaliah commented 4 months ago

Option 1 Delete your server and rerun terraform apply to get a new server with the new user_data script. This will build a new /palworld-server/palworld_backup_script.sh on your server with the fix applied.

if i do this, all my dedicated server save games will lost or not?

ridwanaliah commented 4 months ago

hello, i've updated the module to 1.1.1 version but can you help me how to do the option 2?

image

what command i use to ssh to the palworld_backup_script.sh i need ur help thank you so much.

ridwanaliah commented 4 months ago

image

what should i do next?

ridwanaliah commented 4 months ago

can i copy paste this manually to my local desktop?

image

Josh-Tracy commented 4 months ago

Sorry for the late response.

Looking at your screenshot, it looks like you never got the backup script installed. I do not see the /palworld-server/palworld_backup_script.sh .That means the cron job was never setup either. Option 2 was for editing the backup script manually using vi or some other texte editor as outlined here: https://youtu.be/H0gGtPqhxco?si=8CwsubuxhYZI-qv4&t=334

If that file does not exist then your only option is to destroy the server and recreate it using version 1.1.1. Starting from here: https://youtu.be/H0gGtPqhxco?si=L1OIwfsIkaCVBQEj&t=1175 you an use SCP to move the SaveGame files off your EC2 instance onto your PC to save your data.

Then you can use the restore_from_backup option to start a new sever using your backup files. Be sure to follow the instructions in the README.md and restore_from_backup example. Make sure you get the DedicatedServerName from your GameUserSettings.ini file before you destroy the server.

ridwanaliah commented 4 months ago

If that file does not exist then your only option is to destroy the server and recreate it using version 1.1.1. Starting from here: https://youtu.be/H0gGtPqhxco?si=L1OIwfsIkaCVBQEj&t=1175 you an use SCP to move the SaveGame files off your EC2 instance onto your PC to save your data

I've tried this to scp it but it appears like this:

image

can you help me?

Josh-Tracy commented 4 months ago

../../palworld_public_key is stating that you have the ssh key 2 directories/folders below the C:\Users\User\Desktop\Palworld-Terraform\ directory / folder. You have to provide the path to your SSH key relative to C:\Users\User\Desktop\Palworld-Terraform\.