Installing ERPNext after using Frappe for some time

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