2.0 upgrade.sql causes "Invalid object name" errors (need to run web install first)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
I just successfully performed an upgrade from 1.9 to 2.0 after quite a bit of "spinning my wheels," even though I read through the upgrade's Readme.txt as well as other forum postings.

The core problem is that the instruction of "Install nopCommerce 2.00 to your existing database (1.90)." in the Readme.txt needs to be explained a bit more, as this upgrade is a little more involved than most other upgrades.

I hope this helps!
----------------------
SYMPTOM
Running the nopCommerce 2.0 upgrade script file, upgrade.sql, causes multiple errors, starting with:
Msg 208, Level 16, State 1, Line 3
Invalid object name 'Customer'.

CAUSE
The upgrade script is attempting to use database objects that don't exist yet. You must run the "normal" nopCommerce installation process (i.e. what you'd do if installing nopCommerce 2.0 fresh). This installation process creates the new nopCommerce 2.0 database objects.

For example, in nopCommerce 1.9, the products table is named: Nop_Product
In nopCommerce 2.0, the "Nop_" prefix has been removed, so the new products table is named: Product

RESOLUTION
Perform the following instructions to accomplish step 2, "Install nopCommerce 2.00 to your existing database (1.90)." in the Readme.txt

WARNING: Always make a backup of your database BEFORE attempting perform an upgrade!

Note: The following assumes that you're performing the upgrade on a local test machine, running a local copy of IIS (or one of its derivatives) and local SQL Server.

1. Download nopCommerce_2.00_NoSource.rar from http://nopcommerce.codeplex.com/releases/view/69080 and then unzip the files to a new website folder, e.g. ...\Documents\My Web Sites\nop-2.0

2. Run the website at ...\Documents\My Web Sites\nop-2.0 (using Webmatrix is an easy way to do this).

3. When the Installation Page appears, make sure that the "Create Sample Data" check box is NOT selected. Then provide the SQL Server connection info for your EXISTING nopCommerce 1.9 database.

4. After installation has completed, the new website will NOT show any of your old data, such as products. This is because the new nopCommerce 2.0 website is looking in the Products table, not the nop_Products table, which currently is empty.

Now you can follow the remaining steps in the upgrade's Readme.txt file, including successfully running the upgrade.sql script (which will copy data from the 1.9 "Nop_" tables to the new 2.0 tables.)
9 years ago
zolmedia wrote:
I just successfully performed an upgrade from 1.9 to 2.0 after quite a bit of "spinning my wheels," even though I read through the upgrade's Readme.txt as well as other forum postings.

The core problem is that the instruction of "Install nopCommerce 2.00 to your existing database (1.90)." in the Readme.txt needs to be explained a bit more, as this upgrade is a little more involved than most other upgrades.

I hope this helps!
----------------------
SYMPTOM
Running the nopCommerce 2.0 upgrade script file, upgrade.sql, causes multiple errors, starting with:
Msg 208, Level 16, State 1, Line 3
Invalid object name 'Customer'.

CAUSE
The upgrade script is attempting to use database objects that don't exist yet. You must run the "normal" nopCommerce installation process (i.e. what you'd do if installing nopCommerce 2.0 fresh). This installation process creates the new nopCommerce 2.0 database objects.

For example, in nopCommerce 1.9, the products table is named: Nop_Product
In nopCommerce 2.0, the "Nop_" prefix has been removed, so the new products table is named: Product

RESOLUTION
Perform the following instructions to accomplish step 2, "Install nopCommerce 2.00 to your existing database (1.90)." in the Readme.txt

WARNING: Always make a backup of your database BEFORE attempting perform an upgrade!

Note: The following assumes that you're performing the upgrade on a local test machine, running a local copy of IIS (or one of its derivatives) and local SQL Server.

1. Download nopCommerce_2.00_NoSource.rar from http://nopcommerce.codeplex.com/releases/view/69080 and then unzip the files to a new website folder, e.g. ...\Documents\My Web Sites\nop-2.0

2. Run the website at ...\Documents\My Web Sites\nop-2.0 (using Webmatrix is an easy way to do this).

3. When the Installation Page appears, make sure that the "Create Sample Data" check box is NOT selected. Then provide the SQL Server connection info for your EXISTING nopCommerce 1.9 database.

4. After installation has completed, the new website will NOT show any of your old data, such as products. This is because the new nopCommerce 2.0 website is looking in the Products table, not the nop_Products table, which currently is empty.

Now you can follow the remaining steps in the upgrade's Readme.txt file, including successfully running the upgrade.sql script (which will copy data from the 1.9 "Nop_" tables to the new 2.0 tables.)



i appreciate all the help that has been offered to people trying to get past the 1.9 - 2.0 hump.
i have a good idea what i'm doing but i can not get 2.0 to install.
i have read countless posts, downloaded the scripts and still can not get past the errors generated when the 2.0 install scripts start - namely, that attempts have been made to insert NULLS into a table that does not allow them.

just as an aside - i have 1.3 running in a 'live' environment and copied everything to another server.
just as an exercise, i installed 3.5 on the same server without any significant issues, using VS2013, etc. but i need to get the data from 1.3 to the new site, so as i understand it the only way to do this is to upgrade the old site from 1.3 to 3.5 unless i want to reenter all the data from the old site, and that's not an option.

so on the copy of the 1.3 website, i ran the db upgrade scripts up to 1.9 without any issues
i installed 1.9 'over' 1.3, deleting all the old files
i copied back the settings.txt, etc files back to the 1.9 site
when i run the 1.9 to 2.0 install (without sample data), i get the following :

Cannot insert the value NULL into column 'Rtl', table 'nopcomtest.dbo.Language'; column does not allow nulls. INSERT fails.

can someone *please* tell me how to get past this?

p.s., the video that is mentioned regarding this upgrade is no longer available
8 years ago
Thanks a lot @Zolmedia. Your post really helped. Definitely "Install nopCommerce 2.00 to your existing database" sentence for little confusing. So I skipped it unfortunately.

Thanks again.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.