How to upgrade from setup.py v4 install to pip v5 install

171 views
Skip to first unread message

gary....@gmail.com

unread,
Feb 21, 2024, 10:15:21 AMFeb 21
to weewx-user
I've had a test install of v5 since early alphas. Now, it is time to upgrade my production install.
I have a relatively simple install, Vantage Pro IP driver, weewx-mqtt. A couple of additional internet uploaders (Windy and WeatherCloud). I run two skins, Belchertown and weewx-wdc

All is and has been quite stable. So, I hesitate to poke at it. But, v5 is the new standard, so I need to get this done.

I don't see many who have trod this path. How to go about this?

Tom Keffer

unread,
Feb 21, 2024, 10:39:47 AMFeb 21
to weewx...@googlegroups.com
The pip installs are super easy to back up. Just copy ~/weewx-venv and ~/weewx-data and you have everything you need.

Then activate the virtual environment, then "pip install weewx --upgrade". It should be that easy. If something fails, just roll things back.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b2d73a89-3432-4ad4-8971-34ea51167f24n%40googlegroups.com.

gary....@gmail.com

unread,
Feb 21, 2024, 10:44:02 AMFeb 21
to weewx-user
I understand coming from v5 that would be a way.
I need to upgrade my v4 setup.py to v5 though.
Message has been deleted

michael.k...@gmx.at

unread,
Feb 21, 2024, 11:01:21 AMFeb 21
to weewx-user
I'd do it this way:

- leave your existing installation running

- install v5 the pip way, exactly like described here, including provisioning a new station: https://weewx.com/docs/5.0/quickstarts/pip/
- provision the station with default values
- start and verify it
- copy your old weewx.conf over the newly created one
- check your paths in your weewx.conf (WEWWX_ROOT, HTML_ROOT, SKIN_ROOT and so on)
- in case of using sqlite: copy your database to ~/weewx-data/archive, overwriting the newly created one, if the file names are the same, otherwise delete the newly created one, to have things tidy
- install all extensions (drivers, skins, ...) you had before , see: https://weewx.com/docs/5.0/utilities/weectl-extension/
- if any, copy all your bin/user files that didn't come with an installer to ~/weewx-data/bin/user/

- if your device isn't limited to exclusive access, run weewxd in the venv and validate
- if your device is limited to exclusive access, stop the old installation and run (the new) weewxd in the venv and validate
- once validated, enjoy

Depending on your hardware, you might want to copy the udev rules and apply them (~/weewx-data/util/udev)
Depending on your needs and environment, create and enable systemd scripts (~/weewx-data/util/systemd)

Tom Keffer

unread,
Feb 21, 2024, 11:07:46 AMFeb 21
to weewx...@googlegroups.com
Oh, I thought we were talking about upgrading from an alpha version of v5.

Not much difference. Just set up a V5 virtual environment, then point it at /home/weewx. Follow the directions in the migration guide

gary....@gmail.com

unread,
Feb 22, 2024, 9:28:15 AMFeb 22
to weewx-user
Thanks for the options.

I don't want to have a "hybrid" so won't be following the migration guide method.
Makes more sense to me to install new, install extensions and skins, edit in my config from the existing (old) weewx.conf, copy the database over, remove the old systemd service file, add the new systemd service, move the old install to weewx.old, run the new.

May be a tiny bit more effort but then should be easier for me to maintain/update in the future.



Tom Keffer

unread,
Feb 22, 2024, 10:13:16 AMFeb 22
to weewx...@googlegroups.com
There's nothing special about /home/weewx. You could do

cp -rp /home/weewx ~/weewx-data
cd ~/weewx-data
mv bin bin.old
mkdir bin
cp -r ./bin.old/user bin 

You'll have to adjust your systemd service file to reflect the new location.

-tk

vince

unread,
Feb 22, 2024, 1:23:02 PMFeb 22
to weewx-user
gary - your (re)install upgrade will be quicker if you pre-seed your NOAA files (Belchertown has its own copy too if you use that).  Feel free to PM me if you want to hear my somewhat different way of getting from v4 setup to v5 pip (and multi).

Mark Jenks

unread,
Mar 6, 2024, 6:19:41 AMMar 6
to weewx-user
I think that is the direction I am going to go in also.   I've been using setup.py since the beginning since there was no rpm yet.

I'm going to do the pip install, move all my files around to the new format and restart it there.   Running mariadb, so all my data is in one place already.

Been here since 2011, and it's time to clean up the install anyways.

gary....@gmail.com

unread,
Mar 8, 2024, 8:16:33 PMMar 8
to weewx-user
I took advantage of the opportunity to start with a new OS install and did a pip install. After installing extensions and copying the database to the new location, I edited in the changes from my old weewx.conf file. Surprisingly, I had old driver detritus like interceptor entries that no longer apply.
I use MQTT for several things. Mosquitto doesn't like to share anything SSL related when not running as root. Once done, every piece of the puzzle runs as a user. No more root.
Reply all
Reply to author
Forward
0 new messages