In case I upgrade nopcommerce version, as I got my changes and modifications (in nop.core and in nop template(theme )) will be lost. what are the ways to solve this problem?
No there is no automatic way, you will need to manually re-add the changes you made in the old version to the new version. If you have documented the changes it won’t be too difficult or you can use a tool like DiffMerge to determine the changes you have made by comparing it to a standard unmodified version.
If the changes had been made in plugins this could be more easily managed as you would just need update the plugins to the later version, but it would still be a manual update process
In so many words, yes, if you upgrade, you’ll lose all custom code.
To help, go through your code, and make a comment where you’ve made a modification - a simple //[yourinitials] would do.
Then, make a backup!
When you upgrade, you’ll need to copy over from your back up any changes you’ve made, then of course update those particular changes (if required), to the version you’ve upgraded too.
As you’ve commented your changes (above), it’s just a matter of searching for that comment to find your changes that you’ll need to move over.