SQL script to convert a managed to unmanaged solution in an on-premises Dynamics CRM/365 database.
This is described in detail here
This is meant only as a last resort when trying to recover an unmanaged solution from a managed solution. Use at your own risk.
This is not my script, but the script reference in blog post above (where download link no longer exists).