Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2.2RC1 PHP4.x to PHP5.6.X


sactobob

Recommended Posts

Okay, first let's get this behind. YES, I know it needs updating. But that's not an short-term option, I *DO* plan to update. The situation is; I have a customer (I'm an ISP) that has been told his previous ISP is shutting his server down, with very little notice. I can see why the server needs to go, it's running a VERY OLD cPanel without updates and actually php 4! He has 15 days to move the site. 

The initially clone over to my servers of course has no chance in hell of working. Starting off with Global Register ON in his php 4 environment. No way is that happening here, but my it's not possible anyways as my earliest version of PHP is the latest 5.6.X. 

I've done a few hours of searching and reading, but figured I'd post to see what I'm missing. Is there a way first to get 2.2RC1 working with php5.6 and a how-to somewhere? I know what's basically needs to be done, I've just never worked with OsC (mostly Joomla, WP, Zencart) and if it's been done before I'd rather not spend hours figuring it out again.

There are lots of custom columns in the tables and the front-end is basically not the standard cart (it's not really even a cart). OsC from what I can tell has been used as a back-end product DB with a front-end specific to customer needs. So I don't really need the front-end modified/updated, I'll fix in deprecated errors there.

Once I get him working, I won't be on such a timeline crunch to get him to the latest version or migrate him to something else.

If there are some posts/how-to can someone help me with that as well?

Much Appreciate, Thank you all!

-Robert

Link to comment
Share on other sites

Your customer should install the latest and greatest osC, 2.3.4.1BS "Edge" (see my sig below). They would then migrate over a copy of their database (updating to the new schema) and they're in business. There's no real way to update 2.2RC1 (post 2.2MS2, and maybe 10 years old) to something current that would happily live on PHP 5.6 or higher, that would be any quicker or easier than just moving to the current version. I suppose it could be done, but in this timeframe will take some frantic work.

Regarding all the customizations made to osC, so that even doesn't bear a family resemblance to osC, you could at least try replacing all the osC files with new ones, and see if it works. I'll give you ten-to-one it falls over dead, but it all depends on how much of the original osC has been modified or replaced by their new front end. A lot of the changes between RC1 and Edge have been to the front end, but that's not to say that there haven't been quite a few on the back end. It's even worse if they've been running a "template" on the store (which could itself be massive modifications to the underlying osC software).

If your customer has a detailed list of changes made to osC (how and why), it might not be too painful to replicate them in the new (Edge) store, while updating them to PHP 5.6+. If they don't, well, lesson learned. You can't install software once and expect it to work forever -- changes to the underlying subsystems (PHP, MySQL, etc) demand that it be kept up to date. Since you're an ISP (and/or a hosting service, I take it), do you have an old server or PC sitting around that you could put PHP 4 on and run it (with no guarantees about uptime or security), until a proper upgrade can be done (not in such a frantic hurry)? I'm not sure you can even get PHP 4 any more, but you can look for *AMPP archives.

Link to comment
Share on other sites

I've thought about doing that, I have my own cabinet in a telco and a VMware environment. I could spin up something old if needed, I'm surprised with his current environment of php4 and register globals, the site hasn't been hacked. 

It looks like the backend is really the only thing used for product management, the front-end files includes some osC files for DB connectivity and checkout, but all the regular osC files are removed, so I think it's not all that bad. There are custom rows added into the tables too. I actually had the system up last night, at least osC wise, but the page to login had no fields in it. I made notes what I did to that point, deleted it all and starting again from scratch later today.

I'm leaning toward a fresh install then import just customers/products to existing tables. Or do I only need to run the sql alters that are noted in the upgrade.pdf file to make compatible?

Thanks for your help!

-Robert

Link to comment
Share on other sites

Well, selectively importing data from one osC installation to another will usually cause problems with missing data. Why not just bring everything over by taking a copy of the old DB and either using the upgrade SQL files, or manually comparing all tables and modifying to match the new layout? Be careful not to destroy or break non-osC modifications in the tables. It's entirely possible that some original osC tables or columns have been modified to work with the new front end, so keep good records of what you did, as it's possible you'll be doing some repair work.

So, do you get the feeling that this really no longer an osC installation, but just borrowing its DB structure and some utility routines? In that case, it might indeed be easier to just manually update the utilities to PHP 5.6+, if you can tell what of osC is being used.

Link to comment
Share on other sites

Yes, the site looks like it initially borrowed osC capabilities to store products and process a CC transaction. The front-end isn't anywhere near a shopping cart, it's all custom code to access the DB and present a multiple-choice test (a "product", the product table has a blob added containing answers) to the user and if they pass, they get billed in order to have a certificate mailed to them. I planned to basically get the /admin part working with the AIM module and then work on the front-end. When you say "using the upgrade SQL files", where are those? I must have missed them in the install directory.  The front-end does still require a user registration, appears to use osCs methods to insert the customer into DB so it can keep track of products/tests purchased.

So far I've done a combination of both above. I've been able to export all the data from the old DB (without structure) to the new DB. Taking note of errors, modifying the table to add custom columns and rerunning again. Some of the stuff that throws me is the config table looks like it has module permissions added there, I had to insert code into that (recommended from another post) to get admin logins working as I was getting the 5 minute lock out message. So far with all this step-by-step I have the /admin site working (kinda), the products and customers are there, but some columns are blank. I can add items to a cart with the stock osC front-end, but when I try to check out and register the registration page has no fields on it. I feel I'm really close!

Re temp VM: I started to install an new VM, but my OS of choice(FreeBSD) no longer has a php53 port. I'd prefer to get this working on a modern cPanel anyways, but if I have to I'll look into Centos or other os that can do php53 (last version allowing register globals) and go with that as a temp measure while working with this. I still have a couple of weeks at least. 

-Robert 

Link to comment
Share on other sites

14 hours ago, sactobob said:

When you say "using the upgrade SQL files", where are those? I must have missed them in the install directory.

Each release of osC has an .sql file to be run to migrate the previous version's database schema to the new one. You would have to obtain all the release upgrade packages and study their .sql files, and run them once you understand what they're doing. There's also an "all in one" .sql as an add-on, that will jump you from 2.2MS2 up to something recent (2.3.4?), but that may not be safe to use if your DB has been customized. Or, you can do an EXPORT to .sql on your current DB, an EXPORT to .sql on the new level, and manually compare them and upgrade via phpMyAdmin to get the old DB up to the new. To avoid damaging custom fields, that might be the better choice.

Link to comment
Share on other sites

Yeah, I've been exporting the data only, making any custom table adjustments and importing. I have all the data now in a 2.3.4 osC. And the /Admin is working, except for 2 issues. The customers, they show on the summary page, but clicking the edit but gives me a blank. When I examine the URL from a working customer (the one I added) vs the existing ones, the url is missing the cID? It's like it's not there, but it definately is in the table. 

Here's what a working url looks like clicking [edit]:


https://xyz.com/admin/customers.php?search=testlast&page=1&cID=95992&action=edit

And the broken one:

https://xyz.com/admin/customers.php?search=Stoeger&page=1&cID=&action=edit

The edit button's URL is missing cID???? The table entries look the same, it's almost as if there's no index or something is messing with pulling up an old cust. I've anaylzed/repaired all the tables just to be sure indexes are rebuilt too.

Very strange. Lots of progress at least as far as the 'stock' cart and existing data. 

Any ideas why those customers aren't showing now in admin?

Thanks!

-Robert

Link to comment
Share on other sites

It works! Customer data looks to be inserted from custom code, the entry_country_id column is 0, which defaults to afghan, that the cart doesn't like. Changing all the fields to 223 (US) all the customers are now showing in the back-end and can be edited. Working default/stock /admin! Step 1 complete.

-Robert

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...