Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Event Log too big-cant upgrade from 2.1b Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
kkomara
Newbie
Newbie
Avatar

Joined: June 02 2017
Location: United States
Online Status: Offline
Posts: 31
Posted: December 07 2020 at 07:26 | IP Logged Quote kkomara

Dave,
I am stuck !! As you know I have a VERY old 2.1b system running on Ubuntu Linux/WINE. After finally getting the 2.2b1 and 2.2b2 running on latest Ubuntu 20.04LTS - I am trying to migrate my 2.1b db up to 2.2b2.
Here are the steps I think I need to do:

1) convert 2.1b -> 2.1.2b
2) convert 2.1.2b to 2.1.5c
3) convert 2.1.5c to 2.2b

ON a REAL Windows 10 PC (NOT Linux/WINE):
I downloaded 2.1b/2.1.2b/2.1.5c/2.2b
I Installed 2.1b on real W10 and copied my pwrhome.ini and pwrhome.db FROM my Linux-WINE system. This worked. My Linux-WINE system is running on REAL W10.

I then installed 2.1.2b in a DIFFERENT Subdirectory

BUT 2.1b pwrhome.db file is ALMOST 4GB !! Seems that my EVENT LOG has NEVER been trimmed in the last 7 or 8 YEARS and now when I run the 2.1.2b phupg.exe it sticks on "Copy EVENTLOG table.." for about 3 minutes then just dies. Same thing happens when I run the 2.1b phupg.exe to try to "FIX" my 2.1b pwrhome.db. I can't even view the event log in PH 2.1b - hangs for about 2 minutes and just dies.

Is there any way I can MANUALLY (.e. via some command line sequence) trim/delete the EVENLOG Table in my 2.1b pwrhome.db ?


Anyone lse have any ideas ??

__________________
Kevin Komara
Back to Top View kkomara's Profile Search for other posts by kkomara
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: December 07 2020 at 07:40 | IP Logged Quote TonyNo

ph.trimeventlog ( n )

Where n is a long representing the number of days of data to keep.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
kkomara
Newbie
Newbie
Avatar

Joined: June 02 2017
Location: United States
Online Status: Offline
Posts: 31
Posted: December 07 2020 at 07:56 | IP Logged Quote kkomara

TonyNo
Thanks for the suggestion. So when I run "ph.trimeventlog ( 1 )" in the "Macro/Formula" the command "seems" to execute. I get a type "Macro" event in my PowerHome Status that says "Macro PH.TRIMEVENTLOG ( 1 ) executed". But it runs way too quick. I waited a few minutes then tried to see the Event Log report - and again PH hung the died in about 2 minutes. My pwrhome.db is still almost 4 GB. If this command were to work - I would expect it to run for quite a while to clear out 8 years worth of events !! I figure I will need to manually delete/trim the EVENTLOG table in the pwrhome.db directly via some kind of command line PowerBuilder SQL statement.

__________________
Kevin Komara
Back to Top View kkomara's Profile Search for other posts by kkomara
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: December 07 2020 at 09:11 | IP Logged Quote smarty

Just delete the ".log" file that has grown too large
completely.

Then, copy and rename the "phlogs10.db" file to the
name of the file you deleted. Restart PH and you
should be good to go.

I have done this many times myself until I put in a
timed event to clean the log file ever 48 hours...

Steve



__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
kkomara
Newbie
Newbie
Avatar

Joined: June 02 2017
Location: United States
Online Status: Offline
Posts: 31
Posted: December 07 2020 at 09:19 | IP Logged Quote kkomara

smarty,
Thanks for the suggestion but I do not think this applies to version 2.1b (12 years old). Seems that at some time after this version the event logs were pulled out of the pwrhome.db. But in my version 2.1b the event logs are in the pwrhome.db. So I cannot just delete the .log file. Please correct me if I am wrong.
Thanks,

Kevin K.

BTW - I have been using 2.1b because it was the ONLY version Dave could find (up until 2.2a/b/c) that would run under Linux using WINE.

__________________
Kevin Komara
Back to Top View kkomara's Profile Search for other posts by kkomara
 
kkomara
Newbie
Newbie
Avatar

Joined: June 02 2017
Location: United States
Online Status: Offline
Posts: 31
Posted: December 09 2020 at 08:47 | IP Logged Quote kkomara

ISSUE SOLVED !!!
I was able to connect to the pwrhome.db file through ODBC with a program called RazorSQL. Once connected I manually deleted (32762 records at a time - "delete top 32767 from eventlog where type < 100" ) 5 years of rows in the EVENTLOG table. Took a LONG TIME !! Turns out the WEBLOG table had 5 years of records too - so I manually deleted (32767 records at a time - "delete top 32767 from weblog where type < 100"). Eventually BOTH of these logs got ot the point of no more records. Once that was done I could successfully run the 2.1b phupg.exe to REBUILD my 2.1b databse - and the 2.1b pwrhome.db size went from almost 4GB to only about 2.5MB !!! After that I was able to run the 2.1.2 phupg.exe, then the 2.1.5c phupg.exe, then FINALLY the 2.2b phupg.exe. Now my ENTIRE system is FINALLY running on PowerHome 2.2b - under Ubuntu 20.04 LTS/WINE!!! 8 YEARS in the MAKING FINALLY SUCCESSFUL !!! WOOHOO !!!

__________________
Kevin Komara
Back to Top View kkomara's Profile Search for other posts by kkomara
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: December 09 2020 at 08:51 | IP Logged Quote smarty

Wow... what a great success and a long jouney to get
there!


__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
kkomara
Newbie
Newbie
Avatar

Joined: June 02 2017
Location: United States
Online Status: Offline
Posts: 31
Posted: December 09 2020 at 09:09 | IP Logged Quote kkomara

Thanks smarty !!! I can't actually take all of the credit. I had some help from a colleague. I work for an Engineering Consulting frim in Philly (Customized Energy Solutions) - where my systems control many GW of Electric Power Generation all over the world form our Control Room. I am VERY BLESSED that my hobby is VERY close to my Career !!

One of my star Engineers (Javed Shaikh) who works for me is MUCH better at the lower level DB "stuff". He has LOTS of tricks up his sleeve !! So I described my issue with the PH database - and he connected into my test system at home, poked around - figured out what tool in his tool box he needed to use to access the pwrhome.db through ODBC. Once he got me connected and we browsed through the tables - he and I worked together to create the SQL commands to clean things up !! It was kinda fun - especially since it WORKED !!

__________________
Kevin Komara
Back to Top View kkomara's Profile Search for other posts by kkomara
 
kkomara
Newbie
Newbie
Avatar

Joined: June 02 2017
Location: United States
Online Status: Offline
Posts: 31
Posted: December 09 2020 at 09:10 | IP Logged Quote kkomara

smarty,
BTW - how do I go from "Newbie" to "Super User" ?? I think I am there !!

__________________
Kevin Komara
Back to Top View kkomara's Profile Search for other posts by kkomara
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 09 2020 at 19:30 | IP Logged Quote dhoward

Hey everybody,

Just got out of 3 days at the hospital for an L4/L5 fusion with instrumentation.

I'll try to catch up on messages tomorrow if feel up to it .

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: December 10 2020 at 10:54 | IP Logged Quote smarty

Feel better soon Dave! I too have been batteling some
issues...

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 16 2020 at 22:52 | IP Logged Quote dhoward

Kevin,

Sorry I wasnt really able to help you work through this earlier. You are correct. Version 2.1b has the log tables as a part of the main
database. Due to the exact issues you had, I moved them into their own phlogs.db file. In some previous version of the Database Upgrade
Utility, I had a checkbox option to NOT attempt to import the internal logs as a part of the upgrade but I will have to review to see which one
it was.

I will need to work on updating the previous versions of the Database Upgrade Utility to bring them up to date with the current runtime files
as well as provide this as an option again for people who many be upgrading from ancient versions.

Glad you were able to figure it out though. Just about any generic SQL engine that accepts ODBC DSN's should allow you to do what you did. In
my case, I probably would have just done a "truncate" on the eventlog and weblog tables and that should have handled it for you.

In any event, looks like you're up and running on a current version so I think you'll be much happier now.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum