Might the update db script work?
https://github.com/openenergymonitor/emonpi/blob/master/emoncmsdbupdate.php