The Migrate 5.x Theme Utility can be used as a starting point for upgrading a custom theme from 5.x to 6.x/7.x. It uses the layout export from 5.x along with the original file-based implementation to merge customizations into a working 6.x/7.x theme export.
Its output is a full theme export suitable for importing into a 6.x+ site and a SQL schema patch that can be used to migrate existing theme configuration and layout data in an upgraded database.
For documentation on this utility, see this article.