Installing ERPNext after using Frappe for some time

Method 1:
Use bench export-json and specify the DocTypes you want to export.
Reinstall the site (fresh with no data), install ERPNext in it.
Use bench import-doc with the path of the exported doctypes folder.

Method 2:
Comment out before_install hook inside ERPNext source code.
After installation make sure you manually create a Company, add fiscal year.

Tested using Frappe and ERPNext Version 15.

i dont know whether this will be useful to you. i had similar situation where i created custom app and have 20k rows in some doctypes. i managed to install erpnext after running custom app for some time. link to the solution is mentioned below