Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrading problem #70

Open
DrAdrianJones opened this issue Feb 6, 2025 · 5 comments
Open

upgrading problem #70

DrAdrianJones opened this issue Feb 6, 2025 · 5 comments

Comments

@DrAdrianJones
Copy link

Hi There,

Firstly, thank you for a great how to, it works flawlessly on Proxmox host.

My problem is upgrading the server. After stopping the server, I have:

  1. logged in as immich user
  2. edited the install.env and altered the REPO_TAG to REPO_TAG=v1.125.7
  3. run the install.sh as immich user

but it just reinstalls the original version v1.123.0

What am I missing?

@horstt
Copy link

horstt commented Feb 6, 2025

You need to update the REPO_TAG in both the "install.env" and the ".env" files.

@DrAdrianJones
Copy link
Author

You need to update the REPO_TAG in both the "install.env" and the ".env" files.

Where is the .env file?

@DrAdrianJones
Copy link
Author

You need to update the REPO_TAG in both the "install.env" and the ".env" files.

Where is the .env file?

Ignore that, found it.

It might be worth having a little script to check the latest version and update those 2 file automatically?

@DrAdrianJones
Copy link
Author

You need to update the REPO_TAG in both the "install.env" and the ".env" files.

produced this script to automatically update the 2 files with the latest version number (with a little help form chatGTP)
`#!/bin/sh

Set your GitHub username and repo name

repo="immich-app/immich"

Get the list of tags from the repository (sorted by creation date)

tags=$(curl --silent -m 10 --connect-timeout 5 "https://api.github.com/repos/$repo/tags")

Check if the curl request was successful

if [ $? -ne 0 ]; then
echo "Error: Failed to fetch tag information from GitHub."
exit 1
fi

Check if tags are empty or if no tags are found

if [ -z "$tags" ] || [ "$(echo "$tags" | jq '. | length')" -eq 0 ]; then
echo "Error: No tags found in the repository $repo."
exit 1
fi

Extract the latest tag (first tag in the list)

tag=$(echo "$tags" | jq -r '.[0].name')

Check if jq failed to extract the tag

if [ -z "$tag" ]; then
echo "Error: Could not extract tag_name from the response."
echo "Response was: $tags" # Show the raw response
exit 1
fi

Print current content of .env and install.env before updating (for debugging)

echo "Current content of install.env:"
cat install.env
echo "Current content of .env:"
cat .env

Update the install.env file with the latest tag

sed -i -E "s/REPO_TAG=.*/REPO_TAG=$tag/" install.env

Update the .env file with the latest tag (same as above)

If REPO_TAG is empty or missing, it will be updated or added

sed -i -E "/REPO_TAG=/c\REPO_TAG=$tag" .env

Check if the sed command was successful for both files

if [ $? -eq 0 ]; then
echo "Both install.env and .env updated successfully with tag: $tag"
else
echo "Error: Failed to update install.env or .env"
exit 1
fi

Print updated content of install.env and .env (for debugging)

echo "Updated content of install.env:"
cat install.env
echo "Updated content of .env:"
cat .env
`

@fengqi
Copy link

fengqi commented Feb 9, 2025

You need to update the REPO_TAG in both the "install.env" and the ".env" files.

Where is the .env file?

https://github.com/loeeeee/immich-in-lxc?tab=readme-ov-file#update-the-immich-instance

.env in the folder immich-in-lxc, try ls -a -l

.env file based on the one in install.env, it is not necessary to modify install.env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants