From 74f167978b572a29541ab767ec7f2f5418e32909 Mon Sep 17 00:00:00 2001 From: Syasusu Date: Thu, 25 Jan 2024 20:38:13 +0100 Subject: [PATCH 1/6] add migrate.sh to support migrate from an existing server --- README.md | 23 +++++++++++++++++++++++ migration/migrate.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 migration/migrate.sh diff --git a/README.md b/README.md index b23efda..982d7ab 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,29 @@ For a more detailed list of explanations of server settings go to: [shockbyte](h > If the `/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini` is empty, > delete the file and restart the server, a new file with content will be created. +## Migrate From Existing Server + +1. Find a directory which is named by game server name and contains all saved game data, usually it will at `~/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames/0/` +2. Make sure `migration/migrate.sh`, saved game data directory and mounted volume (e.g. `palworld/`) are in the same directory. Like this: + ```shell + ubuntu@VM-4-5-ubuntu:~/test-pal-migrate$ ll + total 24 + drwxrwxr-x 4 ubuntu ubuntu 4096 Jan 26 03:31 ./ + drwxr-x--- 12 ubuntu ubuntu 4096 Jan 26 03:31 ../ + drwxr-xr-x 2 ubuntu ubuntu 4096 Jan 26 03:30 74406BE1D7B54114AA5984CCF1236865/ + -rw-r--r-- 1 ubuntu ubuntu 840 Jan 25 05:51 docker-compose.yml + -rw-rw-r-- 1 ubuntu ubuntu 848 Jan 26 03:31 migrate.sh + drwxrwxr-x 7 ubuntu ubuntu 4096 Jan 26 03:31 palworld/ + ``` +3. Run `migrate.sh` like this + ```shell + ./migrate.sh {CONTAINER_NAME} {SERVER_NAME} + ``` + For example, + ```shell + ./migrate.sh test-pal-migrate 74406BE1D7B54114AA5984CCF1236865 + ``` + ## Reporting Issues/Feature Requests Issues/Feature requests can be submitted by using [this link](https://github.com/thijsvanloef/palworld-server-docker/issues/new/choose). diff --git a/migration/migrate.sh b/migration/migrate.sh new file mode 100644 index 0000000..599e4af --- /dev/null +++ b/migration/migrate.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +CONTAINER_NAME=$1 +MIGRATION_SERVER_NAME=$2 + +if [ ! -d ./"${MIGRATION_SERVER_NAME}" ]; then + echo "can not find ${MIGRATION_SERVER_NAME} dir at current dir" + exit 1 +fi + +if [ ! -d ./palworld ]; then + echo "can not find palworld dir at current dir" + exit 1 +fi + +CONTAINER_ID=$(docker ps --filter name="${CONTAINER_NAME}" --format '{{.ID}}') + +echo "########## STOPPING CONTAINER ${CONTAINER_NAME} NOW ##########" +docker stop "${CONTAINER_ID}" + +cp -r ./"${MIGRATION_SERVER_NAME}" ./palworld/Pal/Saved/SaveGames/0/"${MIGRATION_SERVER_NAME}"/ + +sed -i "s/DedicatedServerName=.*/DedicatedServerName=${MIGRATION_SERVER_NAME}/" ./palworld/Pal/Saved/Config/LinuxServer/GameUserSettings.ini + +echo "########## STARTING CONTAINER ${CONTAINER_NAME} NOW ##########" +docker start "${CONTAINER_ID}" + + From 36e2feb34041a53df0996ef48657dd633a7f6d42 Mon Sep 17 00:00:00 2001 From: Syasusu Date: Thu, 25 Jan 2024 21:20:17 +0100 Subject: [PATCH 2/6] fix markdown lint check failed --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 982d7ab..91d2454 100644 --- a/README.md +++ b/README.md @@ -191,10 +191,13 @@ For a more detailed list of explanations of server settings go to: [shockbyte](h drwxrwxr-x 7 ubuntu ubuntu 4096 Jan 26 03:31 palworld/ ``` 3. Run `migrate.sh` like this + ```shell ./migrate.sh {CONTAINER_NAME} {SERVER_NAME} ``` + For example, + ```shell ./migrate.sh test-pal-migrate 74406BE1D7B54114AA5984CCF1236865 ``` From 4b4165c0a2e740c11fc31932a149ef5e6faa5899 Mon Sep 17 00:00:00 2001 From: Syasusu Date: Thu, 25 Jan 2024 21:38:09 +0100 Subject: [PATCH 3/6] separate migration readme --- README.md | 26 -------------------------- migration/README.md | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 migration/README.md diff --git a/README.md b/README.md index 91d2454..b23efda 100644 --- a/README.md +++ b/README.md @@ -176,32 +176,6 @@ For a more detailed list of explanations of server settings go to: [shockbyte](h > If the `/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini` is empty, > delete the file and restart the server, a new file with content will be created. -## Migrate From Existing Server - -1. Find a directory which is named by game server name and contains all saved game data, usually it will at `~/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames/0/` -2. Make sure `migration/migrate.sh`, saved game data directory and mounted volume (e.g. `palworld/`) are in the same directory. Like this: - ```shell - ubuntu@VM-4-5-ubuntu:~/test-pal-migrate$ ll - total 24 - drwxrwxr-x 4 ubuntu ubuntu 4096 Jan 26 03:31 ./ - drwxr-x--- 12 ubuntu ubuntu 4096 Jan 26 03:31 ../ - drwxr-xr-x 2 ubuntu ubuntu 4096 Jan 26 03:30 74406BE1D7B54114AA5984CCF1236865/ - -rw-r--r-- 1 ubuntu ubuntu 840 Jan 25 05:51 docker-compose.yml - -rw-rw-r-- 1 ubuntu ubuntu 848 Jan 26 03:31 migrate.sh - drwxrwxr-x 7 ubuntu ubuntu 4096 Jan 26 03:31 palworld/ - ``` -3. Run `migrate.sh` like this - - ```shell - ./migrate.sh {CONTAINER_NAME} {SERVER_NAME} - ``` - - For example, - - ```shell - ./migrate.sh test-pal-migrate 74406BE1D7B54114AA5984CCF1236865 - ``` - ## Reporting Issues/Feature Requests Issues/Feature requests can be submitted by using [this link](https://github.com/thijsvanloef/palworld-server-docker/issues/new/choose). diff --git a/migration/README.md b/migration/README.md new file mode 100644 index 0000000..7567fc3 --- /dev/null +++ b/migration/README.md @@ -0,0 +1,25 @@ +# Migrate From Existing Server + +1. Find a directory which is named by game server name and contains all saved game data, usually it will at `~/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames/0/` +2. Make sure `migration/migrate.sh`, saved game data directory and mounted volume (e.g. `palworld/`) are in the same directory. Like this: + ```shell + ubuntu@VM-4-5-ubuntu:~/test-pal-migrate$ ll + total 24 + drwxrwxr-x 4 ubuntu ubuntu 4096 Jan 26 03:31 ./ + drwxr-x--- 12 ubuntu ubuntu 4096 Jan 26 03:31 ../ + drwxr-xr-x 2 ubuntu ubuntu 4096 Jan 26 03:30 74406BE1D7B54114AA5984CCF1236865/ + -rw-r--r-- 1 ubuntu ubuntu 840 Jan 25 05:51 docker-compose.yml + -rw-rw-r-- 1 ubuntu ubuntu 848 Jan 26 03:31 migrate.sh + drwxrwxr-x 7 ubuntu ubuntu 4096 Jan 26 03:31 palworld/ + ``` +3. Run `migrate.sh` like this + + ```shell + ./migrate.sh {CONTAINER_NAME} {SERVER_NAME} + ``` + + For example, + + ```shell + ./migrate.sh test-pal-migrate 74406BE1D7B54114AA5984CCF1236865 + ``` \ No newline at end of file From fcc2bbf99cf5c1dfc1b35ee3e332aa2a807d595e Mon Sep 17 00:00:00 2001 From: Thijs van Loef <58031337+thijsvanloef@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:44:13 +0100 Subject: [PATCH 4/6] Update README.md --- migration/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/migration/README.md b/migration/README.md index 7567fc3..07d87dd 100644 --- a/migration/README.md +++ b/migration/README.md @@ -1,7 +1,9 @@ # Migrate From Existing Server -1. Find a directory which is named by game server name and contains all saved game data, usually it will at `~/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames/0/` -2. Make sure `migration/migrate.sh`, saved game data directory and mounted volume (e.g. `palworld/`) are in the same directory. Like this: +1. Find a directory which is named by game server name and contains all saved game data, + usually it will at `~/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames/0/` +3. Make sure `migration/migrate.sh`, saved game data directory and mounted volume (e.g. `palworld/`) are in the same directory. Like this: + ```shell ubuntu@VM-4-5-ubuntu:~/test-pal-migrate$ ll total 24 @@ -12,7 +14,8 @@ -rw-rw-r-- 1 ubuntu ubuntu 848 Jan 26 03:31 migrate.sh drwxrwxr-x 7 ubuntu ubuntu 4096 Jan 26 03:31 palworld/ ``` -3. Run `migrate.sh` like this + +5. Run `migrate.sh` like this ```shell ./migrate.sh {CONTAINER_NAME} {SERVER_NAME} @@ -22,4 +25,4 @@ ```shell ./migrate.sh test-pal-migrate 74406BE1D7B54114AA5984CCF1236865 - ``` \ No newline at end of file + ``` From a31927b501f7e86134e84d11ac86368c2542ea83 Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Fri, 26 Jan 2024 09:55:37 +0100 Subject: [PATCH 5/6] update readme and add disclaimer --- migration/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/migration/README.md b/migration/README.md index 07d87dd..cf73b07 100644 --- a/migration/README.md +++ b/migration/README.md @@ -1,9 +1,15 @@ # Migrate From Existing Server +> [!WARNING] +> Use this script at your own risk, I am not responsible for dataloss! +> +> Please make sure you always have a backup! + 1. Find a directory which is named by game server name and contains all saved game data, usually it will at `~/Steam/steamapps/common/PalServer/Pal/Saved/SaveGames/0/` -3. Make sure `migration/migrate.sh`, saved game data directory and mounted volume (e.g. `palworld/`) are in the same directory. Like this: - +2. Make sure `migration/migrate.sh`, saved game data directory and mounted volume + (e.g. `palworld/`) are in the same directory. Like this: + ```shell ubuntu@VM-4-5-ubuntu:~/test-pal-migrate$ ll total 24 @@ -15,7 +21,7 @@ drwxrwxr-x 7 ubuntu ubuntu 4096 Jan 26 03:31 palworld/ ``` -5. Run `migrate.sh` like this +3. Run `migrate.sh` like this ```shell ./migrate.sh {CONTAINER_NAME} {SERVER_NAME} From 6f5a467c7d510dc976fba0b3a4525a8a5f65a051 Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Fri, 26 Jan 2024 11:07:43 +0100 Subject: [PATCH 6/6] add manual steps --- migration/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/migration/README.md b/migration/README.md index cf73b07..9d97d33 100644 --- a/migration/README.md +++ b/migration/README.md @@ -1,5 +1,7 @@ # Migrate From Existing Server +## Using the script + > [!WARNING] > Use this script at your own risk, I am not responsible for dataloss! > @@ -32,3 +34,14 @@ ```shell ./migrate.sh test-pal-migrate 74406BE1D7B54114AA5984CCF1236865 ``` + +## Manually + +1. Copy the save from your old dedicated server to your new dedicated server. +2. In the `PalServer\Pal\Saved\Config\LinuxServer\GameUserSettings.ini` file of the **new** server, + change the `DedicatedServerName` to match your save's folder name. For example, + if your save's folder name is `2E85FD38BAA792EB1D4C09386F3A3CDA`, the DedicatedServerName changes to + DedicatedServerName=`2E85FD38BAA792EB1D4C09386F3A3CDA`. +3. Delete the entire new server save at `PalServer\Pal\Saved\SaveGames\0\`, + and replace it with the folder from the old server. +4. Restart the new server