Post by Randem » Thu Jan 07, 2016 4:48 am

Did you move the opencart.sql file? this is probably the most important step to get a working database.

2. In the OpenCart 2.1.0.1 upload folder, copy or move the opencart.sql file from the install folder to the catalog folder. It is incorrectly expected in the install folder in the install.php and upgrade.php files and expected in the catalog folder.

Any missing tables would be created automatically from this script.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by AllenConquest » Thu Jan 07, 2016 4:59 am

I have worked that issue out. I was because I used a different user to create the new and old databases. However, I'm now getting this error:

Code: Select all

Notice: Undefined index: custom_field in /Users/allenconquest/Developer/opencart2/install/model/upgrade.php on line 381
Probably another 'user error', but do you have any ideas ?

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by Randem » Thu Jan 07, 2016 5:30 am

custom_field is a new field that is added to your database tables oc_address, oc_order & oc_customer. Check those tables for this field

`custom_field` text NOT NULL,

Did you move the opencart.sql file???

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by AllenConquest » Thu Jan 07, 2016 6:00 am

I noticed that these were new columns. However, following your guide, I created a new database in step 6, exported the specified tables in step 7, then deleted the database and recreated it (step 8). I then imported my old database in step 9. This database then has the old tables without these columns.

I copied the opencart.sql file, as I found that if I moved it the installation complained about it not being in the install folder. I will go through the process again and see if I missed anything.

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by AllenConquest » Thu Jan 07, 2016 6:03 am

I also noticed that the default installation does not have an upgrade.php file in the install folder, it is actually in install/model. Did you mean replace this file in step 10 ?

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by AllenConquest » Thu Jan 07, 2016 6:20 am

Sorry for posting so many questions. Would you prefer to take this conversation off-forum?

The first error I get after trying step 10 is:

Code: Select all

2016-01-06 23:11:44 - PHP Notice:  Error: Table 'mavis-shop2.0.event' doesn't exist<br />Error No: 1146<br />SELECT * FROM event in /Users/allenconquest/Developer/opencart2/system/library/db/mysqli.php on line 41
2016-01-06 23:11:44 - PHP Notice:  Trying to get property of non-object in /Users/allenconquest/Developer/opencart2/index.php on line 250
2016-01-06 23:11:44 - PHP Warning:  Invalid argument supplied for foreach() in /Users/allenconquest/Developer/opencart2/index.php on line 250
2016-01-06 23:11:44 - PHP Notice:  Error: Table 'mavis-shop2.0.layout_module' doesn't exist<br />Error No: 1146<br />SELECT * FROM layout_module WHERE layout_id = '1' AND position = 'column_left' ORDER BY sort_order in /Users/allenconquest/
There really is a line in the main index.php that requires the event table (which doesn't exist in the 1.5.5.1 database. So would it be better to not delete the new database in step 8?

I'll wait for your response before posting again, or please send me a private message and we can continue there. I really want to get this upgrade working, as the new responsive open cart 2.x looks really good.

Thanks,

Allen

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by Randem » Thu Jan 07, 2016 6:40 am

No, the required steps are in the order of precedence and they need to be followed exactly. Skipping a step or taking a shortcut may open you up to errors. If you followed the steps verbatim the new tables and fields would exist.

Did you move the opencart.sql file to the required location? this the key to getting the upgrade working properly. The steps are very clear as to where to move it from and to

The upgrade.php file is in the install location and you HAVE to replace it with the one I provided.

BTW: this conversation belongs here. that is how it will help others...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by AllenConquest » Thu Jan 07, 2016 3:03 pm

I have just downloaded 2.1.0.1 again from the open cart download page and unzipped it. There is definitely no upgrade.php file in the install folder to replace (you can also see that on github at https://github.com/opencart/opencart/tr ... ad/install). The upgrade.php file (and the install.php file) is in the upload/install/model folder in the zip file.

I could be misunderstanding, and would be happy to be corrected, but I can't see the files in the location you specified.

Thanks (and I agree this is the place to keep the discussion to help others)

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by AllenConquest » Thu Jan 07, 2016 3:46 pm

Ok. I now have my open cart project setup in NetBeans and can debug the code. When I step through the first installation the line:

Code: Select all

define('DIR_APPLICATION', str_replace('\\', '/', realpath(dirname(__FILE__))) . '/');
in the /install/index.php resolves to "/Users/allenconquest/Developer/opencart2/install/" which means it is looking for opencart.sql in this folder, not the catalog folder. Once the config.php file has been created with the setting for DIR_APPLICATION to be the catalog folder, the upgrade.php would look in that folder. So if you just move the opencart.sql the initial install will fail. Copying the file works. Maybe you could update your instructions to either just say copy this file, or not move it until after step 6 ?

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by Randem » Thu Jan 07, 2016 4:25 pm

I moved the instructions for the copying of the opencart.sql file

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by AllenConquest » Fri Jan 08, 2016 8:44 am

I have debugged through again. This time step 10. I have created the new database, exported the specified tables, recreated an empty database, imported my backed up database, uploaded your upgrade.php file and run the installation again.

Before it gets to the upgrade.php file, it must go through the root index.php file. At line 248 is the following code:

Code: Select all

$query = $db->query("SELECT * FROM " . DB_PREFIX . "event");
This obviously requires the oc_event table. But this is a new table for 2.1.0.1 and didn't exist in 1.5.x. So since I deleted all the new tables and loaded my old ones, this table no longer exists in my database. So this line fails.

I can't see how I can get past this step in the migration instructions, without keeping the new oc_event table. So I put the oc_event table back in the database and tried again. When I look in the error.txt log in /system/storage/logs/ I am getting other tables that don't exist causing problems, such as oc_cart, oc_module and oc_layout_module. All these are new tables.

I'd be interested to know how you overcame these problems.

Thanks,

Allen

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by Randem » Fri Jan 08, 2016 9:02 am

Following the procedures would create the new tables. I have repeated the steps from scratch over a dozen time to verify this. Make sure that you are using the correct upgrade.php file and have removed the other one. If you like send me your SQL dump file that you created of your original database and I will walk it thru the procedure.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by AllenConquest » Fri Jan 08, 2016 9:23 am

A quick update. Looking in the root index.php I noticed lines 11-14:

Code: Select all

if (!defined('DIR_APPLICATION')) {
	header('Location: install/index.php');
	exit;
}
So, I commented out the DIR_APPLICATION definition in my config.php. That made accessing the site go straight to the install/index.php, avoiding the issues with missing tables.

However, I hit another problem. At line 359 in the new upgrade.php file I get the following error:

Code: Select all

Notice: Error: Can't DROP 'value'; check that column/key exists<br />Error No: 1091<br />ALTER TABLE `product_option` DROP `value` in /Users/allenconquest/Developer/opencart2/system/library/db/mysqli.php on line 41
It's getting late now, and I need to sleep, but I'll have another look tomorrow. I'm not sure why that line fails in the script, as I can run the ALTER TABLE command directly against my database and it works without error.

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by Randem » Fri Jan 08, 2016 9:32 am

If you followed the procedure, most likely you are using the incorrect update.php file... Send me your SQL file.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by AllenConquest » Fri Jan 08, 2016 3:07 pm

Randem wrote:Following the procedures would create the new tables. I have repeated the steps from scratch over a dozen time to verify this. Make sure that you are using the correct upgrade.php file and have removed the other one. If you like send me your SQL dump file that you created of your original database and I will walk it thru the procedure.
As I noted in my comments, this problem occurs before the code has even got to the upgrade.php file. Did you have the DIR_APPLICATION defined in your config.php file ?

I will create a fresh install of 1.5.5.1 and run your scripts against that. I don't suppose it could be anything to do with PHP or MySQL versions ?

New member

Posts

Joined
Tue Sep 06, 2011 9:13 pm

Post by Randem » Fri Jan 08, 2016 3:35 pm

I will install a 1.5.5.1 database and do the conversion on that and let you know.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by Randem » Fri Jan 08, 2016 4:23 pm

I just did a conversion from 1.5.5.1 to v2.1.0.1 with all tables being created. Re-download the upgrade.zip to make sure you have the latest version - http://www.randemsystems.com/support/op ... 9/#msg6199

I did make one change but it was unrelated to the issue you are having. Something else is aloof.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by Randem » Fri Jan 08, 2016 5:01 pm

Just did another conversion from v1.5.4 to 2.1.0.1 and all tables are there...

Now I am doing this on a Linux Shared Server and I see you seem to be doing it on a Windows Server.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by Randem » Fri Jan 08, 2016 7:05 pm

If you are still having issues; I can give you a mysqli.php file to use in place of yours that will log all SQL calls so that you can track just what is happening and when.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by HAO » Fri Jan 08, 2016 7:05 pm

I have upgrading database manually from 1.5.6.4 to 2.1.0.1 version, For oc_user, oc_user_group, oc_setting data sheets, directly copied from the new 2.1.0.1, All functions are normal, but Orders that can not be displayed.

The strange thing is, long as I will order the relevant information table cleared, it is possible to use a normal.

How can I deal with this problem?

My Error Code:

Code: Select all

Fatal error: Class 'Controllerpayment' not found in /xxx/public_html/system/storage/modification/system/engine/loader.php on line 28

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: Bing [Bot] and 6 guests