Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
611 views
in Technique[技术] by (71.8m points)

asp.net mvc 4 - Upgrade nopcommerce 2.8 to 3.10

Hello,

I am new in NopCommerce. I have change in Nop.Core, Nop.Data and Nop.Services. I have change also in some controller, Model and view of Nop.web.

If i wish to upgrade nopcommerce version from 2.8 to 3.10 then, which way is easy and best.

1) I backup my file and get update. Once update is finished then, may i replace only those part which i have updated and differ from original code? May i add new method which is in my backup file but not in original code?

2) Or May i have to create new plugin or other way.

[For example: I have change in product table and add new fields like size, age, color.]

Please let me know your valuable feedback.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no straight right or wrong answer. I am suggesting on the approach i took. Assuming you have code changes and database changes on top of base nop 2.80.

Ground Work

Write down a detailed modifications list. (Additional functions you have added on top of 2.80.)

Check with 3.10 if any of your modification is supported out of the box.

My modification count was 250 (very detailed up to estimation).

Approach

  1. Upgrade 2.80 db to 3.10 db.
  2. Modify 3.10 code to support new features of 2.80.

DB Upgrade

  1. Find a good database diff tool. ex: SQL Compare.
  2. Restore your production (2.80) DB to your dev pc and install nop 3.10 db into your dev pc as well.
  3. Compare both DB table by table. Basically, you are going to upgrade 2.80 db to 3.10 db by comparing 3.10 schema.
  4. Alter/Delete/Add new columns in 2.80 by comparing 3.10.
  5. Create Store information (Store table). This is new feature in 3.10 and StoreID is needed for most other tables.
  6. Update customer data to match 3.10 schema.
  7. Update products information. ProductVariant table is now merged with Product table. So need to update product table.
  8. Update Order details. OrderVariant is now OrderItem. So move the data.
  9. Move other tables.

I used to create single SQL Script which,

  1. Restores Production DB from a backup file.
  2. Script block for each table which, upgrades each tables and populates data.

This gives you flexibility of run and run and again run the script if there is any error or even this is helpful during scripting.

In addition to this, if you are merging 2 or more stores in to one,

  1. Add all store information in step 5.
  2. Now create a separate script for each store from this point.
  3. You need to find different sequence number for OrderId & Customer id. Can't be same.
  4. When you add 2nd or more store, check for existing customer before adding.

Check 01

Now take a fresh 3.10 code base and run against your migrated db. All should work well if you have done migration properly.

Code Upgrade

There is significant changes to be done on code simple because there is noProductVariant table. So all the custom logic needs to be re written.

Main issue is, invoicing. If you have more than one store, there is no email setting per store basis. So have to custom modify that too.

A good approach would be,

  1. Do all the customer side eCommerce fist.
  2. Then do the admin side.
  3. If customer and admin in same functionality, do together. example, custom modification on order placing work flow.
  4. There will not be big modification needed for plugins.

Check 02

Run the migrated DB with Updated 3.10 code base. All should work.

On Big Day

  1. Backup Production DB and Production Code base.
  2. Run the Upgrade scripts and Replace new code base.
  3. No 3rd Step, since you have done all the hard work before this.
  4. Ok, if you screw up, then roll back.

Things to Note

I learned these by testing. thank god, i found them before actual migration.

There is no detailed instructions at the time we were migrating on how to setup a complete multi-store solution in nop commerce side. There is a instruction here on how to setup nop commerce in production server. but i is not covering all the aspects.

We were using VPS Server to host our platform. If you are using VPS, please beware that SNI is need to be used if you set up multi-store properly. Only IIS 8 and above supports SNI. Which means you need Windows 2012 Server. See here and here for more on SNI

We were using Pleask to manage the server. So set up master domain as primary and all other stores as alias. In IIS side, RDP in to VPS and Set up SSL for each domain using SNI feature of IIS8

Down side of SNI, it is not supported by all old browsers. See here.

Limitations

If you are using Pleask, then email wont work very well. Since email box will be created only for master domains and all other alias will share the same email accounts. So you can send a reply from alias email. unfortunately, its out of nop commerce development scope.

i haven't found a solution for this. working on this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...