First off, let me thank you for your assistance and direction here. You pointed me to the sqlite utilities which is what I was wondering; can I use them here. I am taking the time to learn more about sqlite database. Second off, thank you for kindly answering when I clearly didn't use the group search function effectively. There is a lot of useful information on this group. Thanks for sharing the nice weewx application too.
Brian On Friday, April 24, 2020 at 4:21:11 AM UTC-7, Tom Keffer wrote: > > I seem to recall there was a thread on the forum about this not too long > ago. > > The simplest would be to dump one file, using the tools sqlite3, then > import into the other, again using sqlite3. Something like (NOT TESTED): > > echo ".dump archive" | sqlite3 file1.sdb | grep -v 'CREATE TABLE' > >file1.sql > sqlite3 file2.sdb < file1.sql > > where file1.sdb is the sqlite database you want to add to file2.sdb. > > The first line dumps file1.sdb, removing the 'CREATE TABLE' statement > (you don't want it because you already have the table in file2.sdb). It > saves the results to file1.sql, which will be full of SQL "INSERT" > statements. > > The second line then uses that file to insert the new data into file2.sdb. > > Needless to say, make backups first. > > -tk > > > > > > > On Thu, Apr 23, 2020 at 8:59 PM B Major <[email protected] <javascript:>> > wrote: > >> I would like to merge 2 weewx SQLite databases. I am currently planning >> to use the wee_import function. Is there a better way to do this? >> >> The back story here is that I recently got a new desktop. I installed the >> latest version of weewx and had it running in short order. I have my old >> weewx SQLite database. I'd like to keep all that data. As noted, I was >> going to just use wee_import to the new database after extracting the >> records from the old one. But given that it appears that these are of the >> same format is there an easier way to do this? I've been running the new >> system for a couple of weeks so swapping out databases may be an option but >> I'd like to keep those 2 weeks of data. These files are Linux based. >> >> Any suggestions or ideas for ease of effort would be appreciated. >> >> >> -- >> 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] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/f227d9ab-78ed-41b0-a7ee-75a1114dcb8e%40googlegroups.com >> >> <https://groups.google.com/d/msgid/weewx-user/f227d9ab-78ed-41b0-a7ee-75a1114dcb8e%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/e75a8e17-b0bc-46a5-9d4e-7236921e2bd0%40googlegroups.com.
