Upgrading weewx
Version: 2.7.0

This document contains the following sections:

The section Instructions for Specific Versions applies to each installation method.

Warning!
You must use the same upgrade technique as your initial install!

For example, if you used setup.py to install weewx, you should use setup.py to upgrade.

If you used a DEB or RPM package to install, then you should upgrade using the same package type.

Upgrading using setup.py

Before upgrading weewx, check the section Instructions for Specific Versions to see if any specific actions are required. Then follow the standard installation procedure:

Unpack the archive:

tar xvfz weewx-X.Y.Z.tar.gz

Change directory into it:

cd weewx-X.Y.Z

Build the distribution:

./setup.py build

Install weewx:

Warning!
Before doing the next step, be sure that home in the file setup.cfg is set to the location of the previous weewx installation.

sudo ./setup.py install

The install process will do the following:

Upgrading using DEB package

Upgrade to X.Y.Z like this:

sudo dpkg -i weewx_X.Y.Z-R.deb

The upgrade process will not modify the weewx databases.

Unmodified files will be upgraded. If modifications have been made to the weewx configuration, you will be prompted as to whether you want to keep the existing configuration or accept the new configuration. Either way, dpkg will save a copy of the option you did not choose.

For example, if /etc/weewx/weewx.conf was modified, dpkg will present a message something like this:

Configuration file `/etc/weewx/weewx.conf'  ==> Modified (by you or by a script) since installation.  ==> Package distributor has shipped an updated version.    What would you like to do about it ? Your options are:     Y or I : install the package maintainer's version     N or O : keep your currently-installed version       D : show the differences between the versions       Z : start a shell to examine the situation  The default action is to keep your current version. *** weewx.conf (Y/I/N/O/D/Z) [default=N] ?

Choosing I (install the new version) will place the previous configuration in /etc/weewx/weewx.conf.dpkg-old where it can be compared with the new version /etc/weewx/weewx.conf

Choosing O (keep the current version) will place the new configuration in /etc/weewx/weewx.conf.dpkg-new where it can be compared with the old version /etc/weewx/weewx.conf

Upgrading using RPM package

Upgrade to X.Y.Z like this:

sudo rpm -U weewx-X.Y.Z-R.rpm

The upgrade process will not modify the weewx databases.

Unmodified files will be upgraded. If modifications have been made to the configuration, rpm will display a message about any differences between the changes and the new configuration. Any new changes from the upgrade will be noted as files with a .rpmnew extension and the modified files will be left untouched.

For example, if /etc/weewx/weewx.conf was modified, rpm will present a message something like this:

warning: /etc/weewx/weewx.conf created as /etc/weewx/weewx.conf.rpmnew

Instructions for specific versions

V2.6 or earlier

Version 2.7 is backwards compatible with earlier versions with one minor exception.

It now includes the ability to localize the weewx and server uptimes. Previously, the labels days, hours, and minutes were hardcoded in a Python utility. There was no way of changing them. Now, like any other labels, they are taken from the skin configuration file, skin.conf, section [[Labels]]. Older configuration files had a definition for hour, but none for day, and minute. Also, the old definition for hour used an abbreviation hrs instead of hours.

If you do nothing, your weewx and station uptimes will look like:

Weewx uptime:  1 day, 1 hrs, 41 minutes
Server uptime: 2 days, 10 hrs, 22 minutes

Note how the label for hours is abbreviated and always uses the plural. If you want the previous behavior, or if you want to localize the labels, you should update your skin configuration file. Remove the old entries for hour and second and replace them with:

day               = " day",    " days"
hour              = " hour",   " hours"
minute            = " minute", " minutes"
second            = " second", " seconds"

The first item is the singular spelling, the second the plural. This will result in the desired

Weewx uptime:  1 day, 1 hour, 41 minutes
Server uptime: 2 days, 10 hours, 22 minutes

V2.5 or earlier

Version 2.6 is backwards compatible with earlier versions, with a couple of small exceptions.

V2.3 or earlier

The option time_length will now be the exact length of the resultant plot. Before, a plot with time_length equal to 24 hours would result in a plot of 27 hours, now it's 24 hours. If you want the old behavior, set it equal to 27 hours. To do this, change your section in skin.conf from

[[day_images]] x_label_format = %H:%M bottom_label_format = %m/%d/%y %H:%M time_length = 86400 # == 24 hours

to

[[day_images]] x_label_format = %H:%M bottom_label_format = %m/%d/%y %H:%M time_length = 97200 # == 27 hours

The service StdTimeSync now synchronizes the console's onboard clock on startup. This is nice because if the clock failed, perhaps because the battery was taken out, the time is corrected first before data is downloaded from the logger's memory. To take advantage of this, you can move service StdTimeSync to the front of the list of services to be run. For example:

[[WxEngine]] # The list of services the main weewx engine should run: service_list = weewx.wxengine.StdTimeSynch, weewx.wxengine.StdConvert, weewx.wxengine.StdCalibrate, weewx.wxengine.StdQC, weewx.wxengine.StdArchive, weewx.wxengine.StdPrint, weewx.wxengine.StdRESTful, weewx.wxengine.StdReport

V2.2 or earlier

The signature of the function "loader", used to return an instance of the station device driver, has changed slightly. It has changed from

loader(config_dict)

to

loader(config_dict, engine)

That is, a second parameter, engine, has been added. This is a reference to the weewx engine.

This change will affect only those who have written their own device driver.

V2.1 or earlier

Version 2.2 introduces a schema, found in bin/user/schemas.py, for the stats database. This schema is used only when initially creating the database. If you have a specialized stats database, that is, one that saves types other than the default that comes with weewx, you should edit this file to reflect your changes before attempting to rebuild the database.

V1.14 or earlier

Version 2.0 introduces many new features, including a revamped internal engine. There are two changes that are not backwards compatible:

All skins should be completely backwards compatible, so you should not have to change your templates or skin configuration file, skin.conf.

If you have written a custom report generator it should also be backwards compatible.

V1.13 or earlier

Version 1.14 introduces some new webpages that have been expressly formatted for the smartphone by using jQuery.

The skins shipped with the distribution take advantage of these features. If you do nothing, your old skins will continue to work, but you will not be taking advantage of these new webpages.

If you want them, then you have two choices:

  1. Rename your old skin directory (call it "skins.old") then do the install. This will install the new skin distribution. You can then modify it to reflect any changes you have made, referring to skins.old for guidance. If you have not changed many things, this approach will be the easiest.
  2. Alternatively, change the contents of your existing skin directory to include the new webpages. If you take this approach, you will need to copy over the contents of the subdirectory skins/Standard/smartphone from the distribution into your skins/Standard directory. You will then need to modify your skin.conf.

    After the section that looks like

    [[[Mobile]]] template = mobile.html.tmpl

    add the following directives:

    [[[MobileSmartphone]]] template = smartphone/index.html.tmpl [[[MobileTempOutside]]] template = smartphone/temp_outside.html.tmpl [[[MobileRain]]] template = smartphone/rain.html.tmpl [[[MobileBarometer]]] template = smartphone/barometer.html.tmpl [[[MobileWind]]] template = smartphone/wind.html.tmpl [[[MobileRadar]]] template = smartphone/radar.html.tmpl

    Then modify section [CopyGenerator] to add the highlighted files:

    [CopyGenerator] # # This section is used by the generator CopyGenerator # # List of files that are to be copied at the first invocation of the generator only copy_once = backgrounds/*, weewx.css, mobile.css, favicon.ico, smartphone/icons/*, smartphone/custom.js

Whichever approach you chose, the generated files will appear in public_html/smartphone. The start of the document root will be at public_html/smartphone/index.html. You may want to add a link to this in the template for your main index page skins/Standard/index.html.tmpl.

V1.12 or earlier

Version 1.13 changed the way binding happens to the databases used in reports so that it happens much later. The upshot is that the signature of a few functions changed. Most you are unlikely to encounter. The exception is if you have written custom template search lists, as described in the section Extending an existing report generator in the Customizing weewx guide. This section has been updated to reflect the new function signatures. As a side effect, the illustrated example actually has become much simpler!

No changes to skins.

V1.9 or earlier

Version 1.10 introduced several new features.

New almanac features, icon, and mobile template

Version 1.10 introduces some extra almanac features, such as the azimuth and elevation of the sun and moon, or when the next solstice will be. It also includes a template formatted for smartphones, as well as an icon ("favicon.ico") that displays in your browser toolbar. The skins shipped with the distribution take advantage of these features. If you do nothing, your old skins will continue to work, but you will not take advantage of these new features.

If you want these new features then you have two choices:

  1. Rename your old skin directory (call it "skin.old") then do the install. This will install the new skin distribution. You can modify it to reflect any changes you have made, referring to skin.old for guidance.
  2. Alternatively, change the contents of your existing skin directory to take advantage of the new features. If you take this approach, you will need to copy over files favicon.ico, mobile.css, and mobile.html.tmpl from the distribution into your skin/Standard directory. Modify skins/Standard/index.html.tmpl to take advantage of the new almanac features, using the version shipped with the distribution for guidance. You will then need to modify your skin.conf.

    Add a new [[[Mobile]]] section:

    [FileGenerator] ... [[ToDate]] ... [[[Mobile]]] template = mobile.html.tmpl

    Then add mobile.css and favicon.ico to the list of files to be copied on report generation:

    [CopyGenerator] copy_once = backgrounds/*, weewx.css, mobile.css, favicon.ico

Which approach you should take will depend on how extensively you have modified the stock skin distribution. If the modifications are slight, approach #1 will be easier, otherwise use approach #2.

Backwards compatibility

With the introduction of explicit control of output units in the templates such as

$day.outTemp.max.degree_C

the calling signature of the following two Python classes was changed

The example of writing a custom generator MyFileGenerator (which produced "all time" statistics) has been changed to reflect the new signatures.

This will only affect you if you have written a custom generator.

V1.7.0 or earlier

With the introduction of a standard archiving service, StdArchive, the names of some events have changed. This will not affect you unless you have written a custom service.

V.1.5.0 or earlier

V1.7 introduces skins. The skins live in subdirectory skins. They are not compatible with the old template subdirectory --- you can't simply rename templates to skins.

The part of the configuration file dealing with the presentation layer has been split off into a separate file skin.conf. Hence, once again, the installation script setup.py will NOT merge your old weewx.conf configuration file into the new one. You will have to re-edit weewx.conf to put in your customizations. You may also have to edit skin.conf for whatever skin you choose (right now, only one skin, Standard, comes with the distribution).

However, a reinstall of V1.7 will merge your changes for weewx.conf. It will also merge any changes you have made to skin.conf as well.

Please check the following:

The directory 'templates' is no longer used; it has been replaced with directory 'skins'. You may delete it if you wish:

rm -r $WEEWX_ROOT/templates

V1.4.0 or earlier

Because the configuration file weewx.conf changed significantly going from V1.4 to V1.5, the installation script setup.py will NOT merge your old configuration file into the new one. You will have to re-edit weewx.conf to put in your customizations.

V1.2.0 or earlier

Optional

Option clock_check, previously found in the [VantagePro] section, is now found in the [Station] section. The install program will put a default value in the new place, but it will not delete nor move your old value over. If you have changed this value or if you can't stand the thought of clock_check appearing in two different places, you should delete the old one found under [VantagePro] and make sure the new value, found under [Station] is correct.

Two Python files are no longer used, so they may be deleted from your installation if you wish:

rm $WEEWX_ROOT/bin/weewx/processdata.py rm $WEEWX_ROOT/bin/weewx/mainloop.py

In addition, file readme.htm has been moved to subdirectory $WEEWX_ROOT/docs, so the old one can be deleted:

rm $WEEWX_ROOT/readme.htm