Upgrade from 12 to 13

Hello.
How can I upgrade from erpnext 12 to erpnext 13 without loosing customization (doctype and core python code) . and can someone share the instructions of an upgrade please .

Please refer to this