I encountered some errors in importWorld.sh which I managed to fix with some minor tweaking, so I thought I'd create an issue for them and look at contributing those fixes.
I got a syntax error for if [ $worldName == "" ]; then which I managed to fix by changing it to if [[ $worldName == "" ]]; then
If your import doesn't have .config/unity3d/IronGate/Valheim/prefs, then the script fails to insert a record into the DB for that world because $worldCreation is empty. This I solved with
if [ -z "$worldCreation" ]; then
worldCreation=$(date +'%F %T')
fi
Additionally, I had to add an extra option to check for worlds in another location in the import_wip folder because I was importing from an export I did on a dedicated game server, not from my local computer. It'd be nice to have a --world option to point directly to the file you want to import. I first tried
if [ -d "import_wip/worlds" ]; then
worldDir="import_wip/worlds"
fi
Which is where my .db and .fwl files were location however the script failed to cp from there, even though the location was correct. Instead, I had to change it to an absolute path, and it copied correctly:
It might be worth adding the current working directory here and here to make them absolute paths as well.
Also, even if it's not ready yet it would still be good to have some mention of this import script in the README, since there doesn't appear to be any other method for importing worlds
I encountered some errors in
importWorld.sh
which I managed to fix with some minor tweaking, so I thought I'd create an issue for them and look at contributing those fixes.if [ $worldName == "" ]; then
which I managed to fix by changing it toif [[ $worldName == "" ]]; then
.config/unity3d/IronGate/Valheim/prefs
, then the script fails to insert a record into the DB for that world because$worldCreation
is empty. This I solved withAdditionally, I had to add an extra option to check for worlds in another location in the
import_wip
folder because I was importing from an export I did on a dedicated game server, not from my local computer. It'd be nice to have a--world
option to point directly to the file you want to import. I first triedWhich is where my .db and .fwl files were location however the script failed to cp from there, even though the location was correct. Instead, I had to change it to an absolute path, and it copied correctly:
It might be worth adding the current working directory here and here to make them absolute paths as well.
Also, even if it's not ready yet it would still be good to have some mention of this import script in the README, since there doesn't appear to be any other method for importing worlds