web2py can import tables saved in csv format therefore it can access legacy data.
web2py can also access existing databases directly (MySQL, PostgreSQL, SQLite and Oracle) if each table has an auto increment field called "id" and if this is the field used for referencing.
Most legacy databases can be converted into the above format by using ALTER TABLE. If the legacy database cannot be converted into such format, it probably has design issues and should be reworked anyway. web2py tries to enforce good software engineering practice. HOWEVER, IN REALITY THIS IS UNREALISTIC AND IS A GREAT DRAWBACK IN ANY ATTEMPT TO USE WEB2PY ON LEGACY SYSTEMS.