Besides Vince's suggestion, here's another one. There's a utility called
transfer_db.py in the examples subdirectory that does something very close
to what you seek. Modify it slightly, and you'd end up with (NOT TESTED):
from __future__ import with_statement
from weewx.manager import Manager
old_archive_dict = {'driver' : 'weedb.sqlite',
'database_name' : '/home/weewx/archive/weewx.sdb'}
new_archive_dict = {'driver' : 'weedb.sqlite',
'database_name' : '/home/weewx/archive/new.sdb'}
with Manager.open(old_archive_dict) as old_archive:
with Manager.open(new_archive_dict) as new_archive:
# This is very fast because it is done in a single transaction
context:
new_archive.addRecord(old_archive.genBatchRecords())
This will merge the contents of the "old database" into the "new database".
Modify paths for database_name for the old and new databases as necessary.
Then rebuild the daily summaries of the new database.
-tk
On Fri, Oct 23, 2020 at 10:47 AM vince <[email protected]> wrote:
> I think you're overthinking things.....but your basic steps look good.
>
> To import the old data into the new db, you would need to convert your old
> db to the new/bigger schema (if your new db uses the big schema), do the
> dump, and restore just the INSERT lines (like you did) and rebuild_daily
> again.
>
>
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/23d29e1a-7fef-4973-b183-70b032136a58o%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/23d29e1a-7fef-4973-b183-70b032136a58o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAv33RNm-oQFJ5GTKmkNbxF08oYptzS%3DPXBcDMx%3DMow2g%40mail.gmail.com.