- Moved the legacy database URL conversion function to improve clarity.
- Introduced a new function to handle legacy database stamping before migrations.
- Updated error handling during migration to ensure legacy databases are properly managed.
- Cleaned up redundant code and improved comments for better maintainability.