cp /home/weewx/archive/weewx.sdb /home/weewx/archive/weewx-backup.sdb
2.1) Make sure you have a backup of your database. Verify with
ls -al /home/weewx/archive/
2.2) If you feel comfortable that you have a backup of your database move to step 3.
3) Run this command. It will delete all rows where the timestamp's year is 2017. Change 2017 if you want to focus on another year.
sqlite3 /home/weewx/archive/weewx.sdb
DELETE FROM archive WHERE strftime("%Y", datetime(dateTime, "unixepoch", "localtime")) = "2017"
4) Rebuild your daily values with the below. You can skip the drop-daily, but you may want to run it so it will drop all your daily records which should purge anything from 2017 that's lingering.
sudo wee_database --drop-daily
sudo wee_database --rebuild-daily
5) Start weewx
If for some reason something get's messed up, you can stop weewx. Rename your backup database back to the primary (with cp /home/weewx/archive/weewx-backup.sdb /home/weewx/archive/weewx.sdb), start weewx. Walk away for a bit to clear your head, come back and try again from step 1.