Fixing logging for the Upgrade Tools.

Also: Re-implementing the methods to create DB connections for the
upgrade tasks.