Can Weewx '5' install on top of itself? (Explained below)

88 views
Skip to first unread message

jpb...@gmail.com

unread,
Feb 16, 2023, 5:28:01 PM2/16/23
to weewx-development
Hi -

Let's say I have Weewx 5 already installed, fully running.

Let's say, for whatever reason, Weewx - with version X.Y.Z installed  - will be installed AGAIN - as that same version  (perhaps by a packaging script has a rule that, always, when it sees a prerequisite of a package has been updated, rebuilds all dependent packages.

Most every package easily handles this odd case of having the same or newer version installed on top of itself. I am sure weewx will handle the 'new version' case - but will it handle having the same version put on top of itself?

Thanks!

Tom Keffer

unread,
Feb 16, 2023, 5:49:42 PM2/16/23
to jpb...@gmail.com, weewx-development
I got kind of lost following your question. 

If you install version x.y.z, there's nothing to stop you from installing x.y.z again. It will just overwrite the last copy. 

As for the packaging script, it doesn't work that way. At least, pip does not. If a dependency gets updated (say, configobj), it does not trigger a reinstall of WeeWX. Is that what you're asking?


Vince Skahan

unread,
Feb 16, 2023, 6:36:06 PM2/16/23
to weewx-development
Packagers generally won't overwrite a pre-existing copy of the identical copy unless you specifically tell it to do so, usually by passing it a switch to say --force or --reinstall or the equivalent explicitly.

Do you mean 'pip' or 'apt' or 'yum' or 'rpm' specifically, and what do you mean by 'rebuilds' in your question ?
  • yum has a 'reinstall' command
  • apt-get has a --reinstall option
  • pip has a --upgrade --force-reinstall option
What exactly is your scenario and what are you concerned will be overwritten (or not overwritten) ?

Joel Bion

unread,
Feb 18, 2023, 4:15:23 AM2/18/23
to Vince Skahan, weewx-development
I’d like to apologize for the somewhat scattered earlier email. Sent in a hurry, and not cleaned up.

My question is based on my particular situation: I have a custom build of Linux, based on (but diverging from) a build-it-yourself model called Linux From Scratch. 

I’ve also built a series of scripts to help me update packages and anything that directly or indirectly depends on the changed packages. It’s a bit of a hobby of mine that’s part of the backyard weather station hobby many of us enjoy.

But a result of this is that packages will often get rebuilt and reinstalled after updates to packages they leverage happen. A great example of this is PHP, which leverages so many packages I’ve installed that it gets rebuilt once a month on average. 

But…  I’ve  generally _not_ done that with Weewx, one of the few packages that I don’t rebuild in this routine matter. Why? Because WeeWX generates _real world data_. The entire rest of the system is in place _just_ so Weewx and a web server can run. I’ve been careful upgrading Weewx as I don’t want to make a mistake in “rebuilding the same version on top of itself” that corrupts or loses my weather data. I’ve also appreciated that Weewx has been self-contained - everything in /home/Weewx. 

I am curious if that caution is still necessary and if I can reinstall version XYZ of Weewx on top an installation _already_ running XYZ.

The kind replies to my earlier question answers this.

Sent from my iPhone

On Feb 16, 2023, at 3:36 PM, Vince Skahan <vince...@gmail.com> wrote:

Packagers generally won't overwrite a pre-existing copy of the identical copy unless you specifically tell it to do so, usually by passing it a switch to say --force or --reinstall or the equivalent explicitly.
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/de69c906-9ace-482c-812a-3b6dbe278152n%40googlegroups.com.

Tom Keffer

unread,
Feb 18, 2023, 8:49:11 AM2/18/23
to Joel Bion, Vince Skahan, weewx-development
There are two parts to WeeWX: the code, and user data. Code is most of the things in /home/weewx/bin. User data are the 'archive', 'public_html', and 'skins' directories, plus 'weewx.conf', plus the 'user' subdirectory (/home/weewx/bin/user). In Version 5, this separation will become explicit.

You can always reinstall the code. You don't want to reinstall the user data because you will lose your previous settings and data.

The setup.py install method explicitly recognizes this separation and does not touch the user data with one exception: it does create a new weewx.conf, but it will just have the same contents as your old weewx.conf, plus, possibly, a version number change.  For older versions of WeeWX (V4.2 and earlier) it may also make some changes in your new copy of weewx.conf to reflect configuration changes. Newer versions of WeeWX do not do this. In any case, it always saves a timestamped version of your old weewx.conf.

Bottom line: you can run setup.py as many times as you want. All you will do is accumulate timestamped weewx.conf files.

Same with the upcoming Version 5: you can reinstall with pip as many times as you want. Just don't run "weectl station upgrade" afterwards.

Hope this helps.

-tk



Vince Skahan

unread,
Feb 18, 2023, 1:24:47 PM2/18/23
to weewx-development
On Saturday, February 18, 2023 at 5:49:11 AM UTC-8 Tom Keffer wrote:
... with the upcoming Version 5: you can reinstall with pip as many times as you want. Just don't run "weectl station upgrade" afterwards.

Confused.

I thought you 'always' needed to run "weectl station upgrade" after a v5 pip install so that the data directory always lines up with what pip installed into the code directory.

FWIW - if it's me doing this particular scripting use case I'd add a switch to the pip3 command ala:
  •  'pip install weewx==5.0.1' to freeze the software version pip tries to install
And then examine the output from pip to know whether they need to run "weectl station upgrade" to sync up the data dir to the installed code (or not):
  • if they see 'Requirement already satisfied: weewx'  (a reinstall), they don't need to do anything else
  • if they see 'Installing collected packages: weewx'  (a new install or upgrade), they need to run weectl station upgrade' to catch the data dir up to the code dir
????
 

matthew wall

unread,
Feb 19, 2023, 7:53:11 AM2/19/23
to weewx-development
> On Saturday, February 18, 2023 at 1:24:47 PM UTC-5 vince...@gmail.com wrote:
> On Saturday, February 18, 2023 at 5:49:11 AM UTC-8 Tom Keffer wrote:
> ... with the upcoming Version 5: you can reinstall with pip as many times as you want. Just don't 
> run "weectl station upgrade" afterwards.
>
> Confused.
> I thought you 'always' needed to run "weectl station upgrade" after a v5 pip install so that the data 
> directory always lines up with what pip installed into the code directory.

the intent is that a user should *never* have to run 'weectl station upgrade'

as long as weewx remains backward-compatible, the only time you should have to upgrade your configuration is (1) when a non-backward-compatible change is introduced (signaled by a major version number change), (2) when a new feature is introduced that requires some non-default configuration (e.g., if you want to update a skin), or (3) if you want your config to contain the latest syntax/naming/conventions with no older patterns that require backward-compatibliity from the weewx codebase.

Tom Keffer

unread,
Feb 19, 2023, 8:06:55 AM2/19/23
to matthew wall, weewx-development
I suppose we could not introduce `weectl station upgrade` until it's needed.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Vince Skahan

unread,
Feb 19, 2023, 3:21:26 PM2/19/23
to weewx-development
Isn't having 'upgrade' a good thing for the case where folks want to upgrade the core skins to the newer version ?

Tom Keffer

unread,
Feb 19, 2023, 9:24:14 PM2/19/23
to Vince Skahan, weewx-development
That's a different command: "weectl station upgrade-skins".



Vince Skahan

unread,
Feb 20, 2023, 1:49:03 AM2/20/23
to weewx-development
Yes.  I misspoke earlier.

It would be nice to keep the 'upgrade' option around too since those items tend to change a little as well from version to version and it does provide a nice way to catch up to those changes if desired.  Now whether it's required all the time, that's perhaps a different story.

(FWIW - you might want to push the current docs up to weewx.com when you get a chance.  What's there is a little dated.)
Reply all
Reply to author
Forward
0 new messages