Do a dump, edit the results, then a load:

$ echo ".dump archive" | sqlite3 weewxB4Reinstal.sdb > weewx.sql

(edit out the create table and any duplicate data)

$ sqlite weewx.sdb < weewx.sql

Naturally, make a backup first. It's not strictly necessary to delete out
the duplicate data: you'll just get lots of duplicate primary key errors if
you don't.

-tk

On Thu, Oct 20, 2016 at 11:56 AM, John Masters <[email protected]>
wrote:

> Thanks for the rapid response Tom, as usual you are bang on the money!
>
> john@pikodi:/home/weewx/archive $ sqlite3 weewx.sdb
> SQLite version 3.8.7.1 2014-10-29 13:59:56
> Enter ".help" for usage hints.
> sqlite> select count(outTemp) from archive where dateTime >1470009600 and
> dateTime <= 1472688000;
> 0
> sqlite> select count(outTemp) from archive where dateTime >1470009600 and
> dateTime <= 1472688000 and outTemp not null;
> 0
> sqlite>
>
> However:
> john@beast-ubuntu:~/Desktop/Weewx Data Import$ sqlite3 weewxB4Reinstal.sdb
> SQLite version 3.11.0 2016-02-15 17:29:24
> Enter ".help" for usage hints.
> sqlite> select count(outTemp) from archive where dateTime >1470009600 and
> dateTime <= 1472688000 and outTemp not null;
> 8936
>
> It seems i did something foolish whilst copying the database back to the
> Rpi.
> How can i insert the missing data from the weewxB4Reinstal.sdb into the
> current database on the RPi?
>
> Regards
> John
>
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to