-
-
Notifications
You must be signed in to change notification settings - Fork 761
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
[Breaking] Update Zigbee2mqtt to v.2.0.0 (Read PR Description) #1221
Conversation
This i what i found while testing the instructions:
Here is the log of the update process:
|
cd /opt/zigbee2mqtt | ||
$STD npm ci | ||
$STD pnpm install | ||
msg_ok "Installed Zigbee2MQTT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be a buildstep somewhere with pnpm build
? Maybe I am missing it somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's what the update.sh
script in the zigbee2mqtt repository does.
Maybe it makes sense to use the update script rather than building our own?
It already contains data backup, systemd service handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the Script do an Git Pull, i hate Git pulls, because its breaking often some scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, I didn't realize you changed install to stable version from release assets. I like this approach much better.
The pnpm build
will still be required, I guess, since the script just downloads the source code, not a pre-built release package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pnpm build will still be required, I guess, since the script just downloads the source code, not a pre-built release package.
Exactly. Zigbee2MQTT is written in typescript. The start command only runs the index.js file and without the build command there is no dist
folder with the actual code that can be opened by Node. The TS needs to be transpiled and that is what pnpm build
does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I think you should run pnpm run build
as described in the documentation which will execute tsc && node index.js writehash
and the same should happen in the update part.
https://github.com/Koenkk/zigbee2mqtt/blob/060ae99cff715cc9ef6a0cfa7cae0cdcb17f0c8a/package.json#L23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly the idea. pnpm run build
and pnpm build
are equivalent.
ct/zigbee2mqtt.sh
Outdated
if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then | ||
if ! command -v npm >/dev/null 2>&1; then | ||
if ! command -v pnpm >/dev/null 2>&1; then | ||
echo "Installing NPM..." | ||
apt-get install -y npm >/dev/null 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the Debian npm
package contains pnpm
, does it?
If not, this is what the pnpm website suggest for installing on POSIX systems:
apt-get install -y npm >/dev/null 2>&1 | |
wget -qO- https://get.pnpm.io/install.sh | sh - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the install script uses npm install -g pnpm
, so maybe we should keep it consistent here. With nodejs
being installed, npm
will be present.
Co-authored-by: Sébastiaan <[email protected]>
Thanks for this, I ran into the same issues. I would suggest step 3 and 4 are moved after 5. So it becomes (simplified OP version);
|
I got this error in the end off the script? why? And afterwards it asks for a login to zigbee2mqtt? Cant login with root.... `` ⚙️ Using Default Settings on node proxmox ✔️ Using local for Template Storage. |
What script is this? |
Both the script above on this thread and with the "normal" one from the website :) |
Post the above in verbose. Script Runs fine. The Script from Website not, because the Changes not merged yet You cant Login, because the Script failed and havnt created a User |
Hmmm - strange - when installing now it works - it may have helped now - but it was the same script I used as before (the one above). For info here is the Verbose:
|
I dont mind if I have to wait to update, but my question is, if you create a script to update automatically, I know regarding configuration. yaml mandatory changes, but in the other steps, Will you have a scripting, or I have to do the steps manually, executing MV, CP commands? BR |
I have created a new lxc from your script a a dev and is working fine, Now I only want to know how to update the existing ones. Any script for update them? Thanks for your amazing work |
Just tested and Dev script is working perfectly for new installs |
Co-authored-by: Sébastiaan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
And to update existing ones? |
I got this error when I execute update root@zigbee2mqtt:/opt/zigbee2mqtt# ./update.sh What´s the problem? |
Is it possible to update the top of the PR description that the errors in this thread have been resolved (with a date stamp on the comment of 07012025)? |
Hi! I'm trying to update but it creates another LXC, I come from the tteck's version, do I have to do something before? Thanks! |
You need to run the script inside the zigbee2mqtt LXC. Other than that just do what is listed in this PR (Config update etc.) |
I tried running this new update script. However my LXC was missing However, on the second attempt of the update script, I now encountered: If anyone else encounters this, then just move the previously made backup, back to Then run the install/update script again as usual and it should make its way through as expected. Though for some reason, my configurations script was missing the |
I'm also getting this error when trying to run the before 2.0.0, git was used and this method seem to have been replaced by just downloading a release archive in this commit: d827d42#diff-fa85bfc34a885cde35f9dde9f6d4050aed1d46873fa5b109da22f22499d734e0R49 |
Please read carefully for migration!
Do Step 1-8 and after this execute Script 1-2
For Error-Handling read PR Comments or Linked Issue comments.
✍️ Description
#660
1.) Install pnpm
2.) Do an Update of your config
systemctl stop zigbee2mqtt mkdir -p /opt/z2m_backup cp -r /opt/zigbee2mqtt/data/* /opt/z2m_backup
3.) Change Configuration of configuration yaml
add here in the right sections:
4.) Check if your Adapter is correct configured (i had the same issue)
check this part:
ive used zstack, you can check it here: Koenkk/zigbee2mqtt#24364
5.) go into main path and enter "./update.sh"
cd /opt/zigbee2mqtt ./update.sh
6.) if all is correctly deployed, you can do an testrun
=> if it works, fine, update done
7.) Edit Service for Zigbee2MQTT
change "/usr/bin/npm start" to "/usr/bin/pnpm start" In ExecStart and start the service
8.) Create an App_version.txt for next updates
Hint:
If you have other problems, have a look at the comments to see if your problem is among them.
An alternative solution would be to create a new LXC and export the data-folder from the old one and import it into the new LXC, but this is only theoretical.
🛠️ Type of Change
Please check the relevant options:
✅ Prerequisites
The following steps must be completed for the pull request to be considered: