Wiki

Clone wiki

weewx-wd / Upgrade Guide

Upgrading weewx-WD

Note: Before upgrading the user should check Instructions for Specific Versions below for any specific upgrade instructions. If upgrading weewx-WD 0.9.3 or earlier do not follow these instructions, you must refer to Upgrading from v0.9.x below.

Since version 1.0.0 weewx-WD upgrades are done through use of the weewx wee_extension utility. To upgrade weewx-WD:

  1. Download the weewx-WD extension from the weewx-WD Bitbucket downloads site into a directory accessible from the weewx machine.

    $ wget -P $DOWNLOAD_ROOT https://bitbucket.org/ozgreg/weewx-wd/downloads/weewxwd-X.Y.Z.tar.gz
    

    where $DOWNLOAD_ROOT is the path to the directory where the weewx-WD extension is to be downloaded.

  2. Stop weewx:

    $ sudo /etc/init.d/weewx stop
    

    or

    $ sudo service weewx stop
    
  3. Install the weewx-WD extension downloaded at step 1 using the weewx wee_extension utility:

    $ wee_extension --install=$DOWNLOAD_ROOT/weewxwd-X.Y.Z.tar.gz
    

    This will result in output similar to the following:

    Request to install '/var/tmp/weewxwd-X.Y.Z.tar.gz'
    Extracting from tar archive /var/tmp/weewxwd-X.Y.Z.tar.gz
    Saving installer file to /home/weewx/bin/user/installer/weewx-WD
    Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20161027130000
    Finished installing extension '/var/tmp/weewxwd-X.Y.Z.tar.gz'
    
  4. The wee_extension utility will preserve any user changes (eg customised units) made to weewx-WD related settings in weewx.conf. However, the user may wish to verify that any user changes to weewx-WD related settings in weewx.conf by editing weewx.conf and perusing its contents:

    $ vi weewx.conf
    

    Note: If any changes to weewx.conf were made by the installer during the upgrade a copy of the original weewx.conf will be saved as weewx.conf.YYYYmmddHHMMSS where YYYYmmddHHMMSS represents the date and time the upgrade occurred.

  5. If the weewx-WD related settings in weewx.conf are acceptable, start weewx:

    $ sudo /etc/init.d/weewx start
    

    or

    $ sudo service weewx start
    

Instructions for Specific Versions

Upgrading from v1.0.x

There are no specific instructions for upgrading from weewx-WD v1.0.x.

Upgrading from v0.9.x

weewx-WD v0.9.x was designed to operate with weewx v2.x. weewx-WD v0.9.x relied on the use of unused database fields in the weewx database for the storage of weewx-WD observations. weewx-WD v0.9.x was not packaged as a weewx extension and therefore required manual installation, upgrade and removal. For these reasons there are significant, detailed instructions that must be carried out precisely in order to upgrade from weewx-WD v0.9.x.

Note: In the following code snippets the symbolic name $BIN_ROOT, $SKIN_ROOT and $DOWNLOAD_ROOT must be replaced with the nominal location for your installation.

Note: Copying of significant periods of legacy data can be time consuming. The time taken will depend on the number of records and the capabilities of the host computer/database server. As a guide a Raspberry Pi version 1 with external hard disk can take around 1-2 hours to process 100 000 records, later Raspberry Pi models will be faster.

Removal of legacy files

Remove the legacy weewx-WD files as follows:

  1. Stop weewx:

    $ sudo /etc/init.d/weewx stop or sudo service weewx stop
    
  2. Delete the weewx-WD python files from the $BIN_ROOT/user folder:

    $ sudo rm $BIN_ROOT/user/wd*.py
    $ sudo rm $BIN_ROOT/user/weewxwd*.py
    $ sudo rm $BIN_ROOT/user/imageStackedWindRose*.py
    
  3. Delete the weewx-WD skin folders from the $SKIN_ROOT folder:

    $ sudo rm -R $SKIN_ROOT/Clientraw
    $ sudo rm -R $SKIN_ROOT/PWS
    $ sudo rm -R $SKIN_ROOT/StackedWindRose
    $ sudo rm -R $SKIN_ROOT/SteelGauges
    $ sudo rm -R $SKIN_ROOT/Testtags
    
  4. Edit the weewx configuration file

    $ vi weewx.conf
    
  5. Locate the [StdReport] section and remove the following subsections:

    • [[wdTesttags]],
    • [[wdPWS]],
    • [[wdClientraw]],
    • [[wdStackedWindRose]], and
    • [[wdSteelGauges]]
  6. Locate the [Engine] section and remove user.wd.WD from process_services ensuring that the remaining entries remain a comma separated list with no extra punctuation marks.

  7. Locate the [Engine] section and replace user.wdarchive.WDArchive with weewx.wxengine.StdArchive in the archive_services setting.

Installing weewx-WD

Install weewx-WD as follows:

  1. Download the weewx-WD extension from the weewx-WD Bitbucket downloads site into a directory accessible from the weewx machine.

    $ wget -P $DOWNLOAD_ROOT https://bitbucket.org/ozgreg/weewx-wd/downloads/weewxwd-X.Y.Z.tar.gz
    

    where $DOWNLOAD_ROOT is the path to the directory where the weewx-WD extension is to be downloaded.

  2. Run the installer from the weewx directory and using the location of the file downloaded in step 1:

    $ wee_extension --install $DOWNLOAD_ROOT/weewxwd-X.Y.Z.tar.gz
    

    This will result in output similar to:

    Request to install '/var/tmp/weewxwd-X.Y.Z.tar.gz'
    Extracting from tar archive /var/tmp/weewxwd-X.Y.Z.tar.gz
    Saving installer file to /home/weewx/bin/user/installer/weewx-WD
    Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20161027130000
    Finished installing extension '/var/tmp/weewxwd-X.Y.Z.tar.gz'
    

    Note: Do not start weewx at this stage.

Migrating weewx-WD legacy data

weewx-WD 0.9.3 and earlier utilised the largely unused fields extraTemp1 and extraTemp2 in the weewx database to record the derived observations humidex and apparent temperature. The use of extraTemp1 and extraTemp2 caused problems for some users who used these fields for other observations. As of weewx-WD 1.0.0, these derived observations are now stored in the weewx-WD database and any remaining humidex or apparent temperature data in extraTemp1 and extraTemp2 is considered to be weewx-WD legacy data.

To migrate any weewx-WD legacy data:

  1. Create the weewx-WD database:

    $ wd_database --create-archive
    

    This will result in output similar to:

    Using configuration file /home/weewx/weewx.conf.
    Created database 'weewxwd'
    
  2. Check if there is any legacy weewx-WD data:

    $ wd_database --status
    

    If there is legacy data available, the output will be similar to:

    Using configuration file /home/weewx/weewx.conf.
    Reconstruction of weewx-WD database 'weewxwd' table 'archive' data from 2014-12-24 17:20:00 AEST (1419405600) to 2014-12-25 19:45:00 AEST (1419500700) (approx 2 days) is recommended.
    

    If there is no legacy data available, the output will be similar to:

    Using configuration file /home/weewx/weewx.conf.
    Reconstruction of weewx-WD database 'weewxwd' table 'archive' is not required
    

    Warning: If there is no legacy data available DO NOT complete steps 3 to 5 inclusive.

  3. If there is legacy data available copy this legacy data to the newly created weewx-WD database:

    $ wd_database --copy-v2-data
    

    This will result in output similar to:

    Using configuration file /home/weewx/weewx.conf.
    552 records have been identified to backfill database 'weewxwd' from 2014-12-24 17:19:59 AEST (1419405599) to 2014-12-26 15:54:59 AEST (1419573299) (approx 2 days). 
    Are you sure you wish to proceed (y/n)? y
    Processing 552 records...
    552 record(s) over 1 period(s) covering approximately 2 day(s) processed in 0:00:39.
    
  4. Backfill the weewx-WD daily summaries:

    $ wd_database --backfill-daily
    

    This will result in output similar to:

    Using configuration file /home/weewx/weewx.conf.
    Backfilled 'weewxwd' with 568 records over 3 days in 1.61 seconds
    

    If the backfill was not required as no legacy data was copied, the output will be similar to:

    Using configuration file /home/weewx/weewx.conf.
    Daily summaries up to date in 'weewxwd'.
    
  5. Clear any legacy weewx-WD data from the weewx database:

    $ wd_database --clear-v2-data
    

    If legacy data was found and cleared, the output will be similar to:

    Using configuration file /home/weewx/weewx.conf.
    'extraTemp1' and 'extraTemp2' data in database 'weewx' from 2014-12-24 17:20:00 AEST (1419405600) to 2014-12-26 15:55:00 AEST (1419573300) (approx 2 days) is about to be cleared. Any data in these fields will be irretrievably lost.
    Are you sure you wish to proceed (y/n)? y
    Done. 'extraTemp1' and 'extraTemp2' cleared in 553 records (approx 2 days).
    

    If no legacy data was found, the output will be similar to:

    Using configuration file /home/weewx/weewx.conf.
    No 'extraTemp1' or 'extraTemp2' data found in database 'weewx' that need to be cleared. No data changed.
    

Start weewx

Once the above steps are complete weewx may be started:

  1. Start weewx:

    $ sudo /etc/init.d/weewx start
    

    or

    $ sudo service weewx start
    

Updated