[...long answer follows...]
v5 beta pip user who came from setup.py installation here so let me pass
along my experience and what I did....
This is my personal method and definitely differs from the official steps,
but maybe it will help identify one way to approach setting up a test setup
before throwing the switch and going live with it....
I might add that I'm a Vantage VP2 with datalogger user here, so it's easy
to stop v4, run v5, and then even go back to v4 if needed (I never needed
to do so) and the datalogger will handle catching up an old v4
installation. This is a feature that not all stations have, but it was a
nice security blanket here.
Anyway - apologies for this being verbose. Writing it down just in case
somebody needs to search for it.
1. Set up a v5 pip virtual environment and the station's weewx-data
directory
- created a simulator station using the pip quickstart steps, but did a
couple things differently:
- I added the --no-prompt option to 'weectl station create' so it
didn't prompt me
- I didn't put the weewx.service file into place (yet)
- installed all the skins and extensions I have in my v4 setup.py config
into the new v5 pip weewx-data using 'weectl extension install'
- installed any python modules my skins/extensions require (requests and
paho-mqtt, to name two) into the python venv
- at this point I could activate the python venv and run weewxd and
see simulated data returned
- and after 5 minutes it should save to the simulator weewx.sdb and
run the reports
- if anything goes boom, you missed adding something to your new pip
based installation
- do not (yet) edit weewx.conf to do anything that acts like an uploader
(rsync, mqtt, pws, wu, cwop, and so on)
- do not (yet) do anything to hook into systemd
- if you want to hook the v5 pip public_html into your web at a test
path, perhaps http://xyz/weewx-v5, you can do that now
2. Copied my NOAA files into place. The historical ones take too long to
regenerate if you have many years. When we get to it later the current
month/year will be overwritten correctly.
3. Copied my archive db into place. Don't sweat it getting overwritten
with simulator data. We'll copy the real db (again) when putting v5 pip
into production
4. Run weewxd interactively again and let it run the reports a couple
times. Verify nothing went boom. You should see full graphs etc. and NOAA
reports. Don't sweat the contents. Just ensure it generated them.
5. At this point you have a pretty close to done config. Go ahead and edit
weewx.conf and put in your normal edits there, but be sure to 'enable =
false' all your uploaders etc. still at this point. For me it was anything
that uploaded using MQTT and Belchertown as well as RSYNC to my internet
site and things like PWS. Leave them off for now.
6. Now test the weewx.service file. Save your old one. Let me repeat
that. Save your existing one. Really.
- Be a little careful here if you previously had a /etc/init.d file for
v4 weewx. If so, move that aside, saving the old one.
- copy the service file into place. daemon-reload. systemctl start.
Verify weewx started ok with "ps -elf" and watch your logs
At this point you should have a v5 pip installation that matches your v4
setup.py installation, other than having the uploaders disabled and having
bogus data consisting of historical real data and some appended simulator
cruft data. If you're happy and want to jump to v5 pip you would then:
- stop v5 weewx
- once again copy the v4 archive over into the v5 data tree
- this time you can enable your uploaders
- go for smoke and run v5 now
- tweak your webserver setup to point to the v5 public_html directory
- verify you can surf to your v5 web
- Check your logs. If good, go for the victory pizza.
On Sunday, November 26, 2023 at 11:41:11 AM UTC-8 Joel Bion wrote:
> I seriously think there is a formal case study that needs to be written
> about the challenges of moving WeeWX to the current Python installation
> model.
>
> There’s a lesson here for not just the Python developers but others about
> the difficulty of this transition, because the way WeeWX did things (all
> things under /home/weewx) was not unreasonable but what has been required
> to migrate, and the need to support custom package managers, etc…. I just
> think that this information is useful.
>
>
> Sent from my iPhone
>
> On Nov 26, 2023, at 11:33 AM, Tom Keffer <[email protected]> wrote:
>
>
>
> /etc/weewx/bin is added to the Python path dynamically when weewxd is
> started up. However, because it is added to the end of the path, the
> interpreter will find the version in /usr/share/weewx first.
>
> So, why not add it to the beginning of the Python path? Because that
> causes problems for legacy setup.py installs. In this case, the interpreter
> will find the code in /home/weewx/bin first, which is the old V4.10 code.
> The V5 code is under ~/weewx-venv.
>
> In summary, there's no good solution except to warn users.
>
> -tk
>
>
> On Sun, Nov 26, 2023 at 9:15 AM Karen K <[email protected]> wrote:
>
>> Tom Keffer schrieb am Sonntag, 26. November 2023 um 13:50:23 UTC+1:
>>
>> This issue is already known (always read the Upgrade Guide!). See
>> https://weewx.com/docs/5.0/upgrade/#new-location-for-user-directory
>>
>>
>> This is a slightly other problem here. I did a new clean install, no
>> upgrade.
>>
>> My problem was, that the old directory /usr/share/weewx/user still exists
>> and Python looks for modules there only.
>>
>> So the extensions were installed to /etc/weewx/bin/user, but Python did
>> not look for them there.
>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-development/35032165-08d5-4415-8e9d-d2996ce8ca84n%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/weewx-development/35032165-08d5-4415-8e9d-d2996ce8ca84n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 [email protected].
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-development/CAPq0zEAtRxWk2JG7OYC_ontEnv-fFLLdXGUr2KDzf_nyv24XaQ%40mail.gmail.com
>
> <https://groups.google.com/d/msgid/weewx-development/CAPq0zEAtRxWk2JG7OYC_ontEnv-fFLLdXGUr2KDzf_nyv24XaQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/6062f16b-2fbb-452d-91e4-42037cc3ebc0n%40googlegroups.com.