Add-on Name: OSCommerce to CE Phoenix Migration Utility
Version: 0.2.0
Updated: 03/15/2021
Supports CE Phoenix: >= 1.0.7.0
Supports OS Commerce:Â >= 2.2
Description of Add-on
Features:
- Password protect migration utility to avoid usage from third parties
- Link to OSCommerce MySQL Database
- Link to CE Phoenix MySQL Database
- Link to file structure for OSCommerce Export
- Link to file structure for CE Phoenix Import
- Test server to make sure PHP and MySQL are setup correctly
- Tests read/write/delete security
- Upgrade old OSCommerce Data
- Detects OSCommerce data version by the state of what upgrades are missing.
- Applies upgrades to the database to upgrade OSCommerce to 2.3.4
- Choose what data to migrate
- Queries the OSCommerce tables and allows you to choose any tables you want to transfer, including custom tables that your mods have created
- Check targeted tables in CE Phoenix to make sure table is empty
- Will use the selected tables from the “Choose what data to migrate” and compare those against the target CE Phoenix tables and alert you to any required changes
- Transfer MySQL Data Now
- Will apply any required changes based on previous alerts in previous steps
- All targeted tables in CE Phoenix will be emptied before being populated. There are warnings beside tables in previous steps to avoid this on some tables like “configuration” table
- Any missing tables will be created to match the OSCommerce specs for that table
- Any missing columns will be added to tables prior to import to make sure any custom data is not lost
- All data from OSCommerce database will be migrated to CE Phoenix database
- Will apply any required changes based on previous alerts in previous steps
- Transfer Images Now
- All image files and folders will be migrated from OSCommerce to CE Phoenix
- English language file for all text (Language Switch functionality to come if enough interest)
Future Features:
- Transfer of mods from old code to new code base.
- Download matching core code to compare against OSCommerce install to detect changed files
- Allow choosing of changed files to migrate to CE Phoenix (mods/apps/hooks)
- Scan selected files for old code that could blow-up CE Phoenix and show report before proceeding
- Allow for easy language switching
Screenshot(s)
Change Log
- 0.2.0 (03/15/2021)
- Fixed issue with Chrome not working with samesite cookie settings
- 0.1.20 (02/09/2021)
- Moved some code around to fix issue for some with password cookies not working.
- 0.1.10 (01/16/2021)
- Fix another setting for ‘year’ datatypes (Thanks Iain)
- 0.1.9 (01/15/2021)
- added a setting for bypass_password in the header.php. Set that to 1 to allow no password
- Added ‘year’ as a datatype to catch nulls
- 0.1.8 (12/19/2020)
- Added extra scema to sql migration to avoid issues with matching table names in other databases on the same server using the same user/pass. (Thanks vmn)
- 0.1.7 (11/30/2020)
- fixed cookie code to better handle php versioning and SSL/NON-SSL
- 0.1.6 (10/12/2020)
- added YouTube How-To Video
- fixed some caching issues by disabling browser caching using php headers
- added db schema to avoid anything else being visible from other accessible database tables (Thanks vmn)
- 0.1.5 (10/11/2020)
- fixed issue with bypassing setting a password if initial load defined a step
- fixed logout bug due to 0.1.4 change to cookie
- 0.1.4 (10/10/2020)
- fixed issue with mysql password toggle
- corrected cookie issue with samesite warning
- 0.1.3 (10/09/2020)
- added password hiding options on database fields
- added alerts if php/mysql not sufficient version
- added warning if output_buffering is turned off as large datasets should use output_buffering to watch migration as it progresses
- added link to YouTube channel – demo coming soon
- 0.1.2 (09/30/2020)
- corrected issue with transfer of images when folder depth > 1
- corrected issue with transfer of database if enum, blob, mediumtext, and some others were imported
- corrected issue for creating tables with multiple columns in primary key
- 0.1.1 (09/29/2020)
- Corrected error being caused in some setups by file_get_contents
- Corrected some php alerts that were being logged and may have caused fatal stops depending on server error settings
- 0.1.0 (09/23/2020)
- Initial Release
Download(s)
Install Instructions:
- Â Clone your OSCommerce MySQL database to a new database as the data will be upgraded during the migration.
- Make sure the Cloned OSCommerce MySQL database allows for connections from the server the utility is running on.
- Create a fresh install of CE Phoenix on a network connected server – DO NOT INSTALL TEST DATA! If you do install the test data, the utility will remove it, but it is recommended that you do not install test data to avoid any issues.
- Make sure the CE Phoenix MySQL database allows for connections from the server the utility is running on.
- Unzip this utility and load the utility in your web browser.
- Make sure that you have file path access from the server that the utility is running on, to both the CE Phoenix and OSCommerce installs. This can be done with mapped drives or mount points.
- Make sure you are running PHP >= 7.3 on the server the utility is running on. Also make sure php output_buffering is turned on.
- Happy Migrating
You can now download this addon from the Phoenix Cart Forum Addons Library
https://phoenixcart.org/forum/app.php/addons/free_addon/oscommerce_to_ce_phoenix_migration_utility/
Talk about a time saver…This tools probably saved me hundreds of migration hours and it worked like a charm…Preston makes great tools. This site it’s on my bookmarks to always check for any new tools either paid or free.
Thanks for all you do for the Phoenix-Cart community.
Patrick
March 30, 2021 at 5:49 amQuote:
I have run the migration tool, I can see that all has gone well (the database is filled) but when i click Categories/Products I see nothing?
I checked again and I see that the categories_description and products_description tables are empty, I have tried to import these two tables again but no succes?
I think I will import these two tables by hand and see what happens.
February 17, 2021 at 3:31 amI am sure you did this already, but make sure in the migration that you select (check) those tables along with any others that are needed. I havent heard of that issue before, you may want to check your error logs in both mysql as well as your web error logs … may have clues as to the problem.
February 17, 2021 at 3:33 amI have run the migration tool, I can see that all has gone well (the database is filled) but when i click Categories/Products I see nothing?
February 16, 2021 at 6:28 amMake sure you do NOT migrate the configuration table. Also make sure to migrate all of the tables that are not tagged as recommended. If you did that and you still cannot see anything, make sure you have a “default” language set in the admin. If still nothing, email using the requests page and let me know your website url and login info and I can go have a look for you.
February 16, 2021 at 1:05 pmI get the point where I set the password, then it prompts to enter the new password but then it just goes back to the password entry screen, no further.
February 15, 2021 at 8:10 amYou can edit the /migrate/inc/header.php file and set $bypass_password = 1;
This will remove the need for the password. Another option is to check your log files to see what is causing the issue with the password not being set.
February 15, 2021 at 3:43 pmI bypassed the password requirement and the tool worked great. I am running it in a Debian based container so I believe I was missing php-hash or php-pear as mentioned in earlier comment. Migration tool works great, migrated my installation with ease. @zipurman even provided personal support via email! Thanks for this great tool.
January 18, 2021 at 7:16 pmusing the latest migration tool I just downloaded
January 5, 2021 at 1:58 pmPHP 7.4.11 (Zend 3.4.0)
output_buffers = on
chmod 777 the migrate folder
Looks like Ubuntu does not include php-hash as part of the php7-common. I believe that installing php-hash or php-pear should correct this. Let me know if you have run into this on Ubuntu and what you did to get php hash working. You can test to see if you have php hash by running “php -i | grep -i hash”.
January 5, 2021 at 2:03 pmI get the point where I set the password, then it prompts to enter the new password but then it just goes back to the password entry screen, no further.
January 5, 2021 at 1:16 pmMake sure you are running the latest version, which you can download above. If that doesn’t help, let me know the version of PHP you are using and that the permissions of the migrate folder are such that the script can write to it.
January 5, 2021 at 1:19 pmI got duplicated elements in create statements, because I had multiple db’s with identical table names.
Apply the schema limitation In step17.php, as well:
//VMN$query = mysqli_query( $old_db, “SELECT * FROM information_schema.columns WHERE table_name='{$key}’;” );
$query = mysqli_query( $old_db, “SELECT * FROM information_schema.columns WHERE table_name='{$key}’ and TABLE_SCHEMA='{$config[‘mysql_osc’][‘db’]}’;” );
I might be a qood idea to check errors at least when creating tables. Something like this:
December 6, 2020 at 4:41 amif (!mysqli_query( $db, $createdbquery )) {
error_log(“Error: %s\n:” . mysqli_error($db));
$extratext = ”;
$statustext = mysqli_error($db);
}
else {
$extratext = ”;
$statustext = TEXT_TABLE . ‘ ‘ . TEXT_CREATED . ‘ ‘;
}
Thanks vmn, I have added this to 0.1.8
December 19, 2020 at 5:27 pmHi Zip,
I finally found the issue and add the Secure param to the setcookie function :
‘samesite’ => ‘None, Secure’,
(twice in header.php, line 54 and 93)
For information, I’m running Microsoft Edge 87.0.664.47 (Chromium).
Hope this helps !
November 28, 2020 at 7:58 amAdded some logic to version 0.1.7 to detect php version as well as SSL to format cookie strings as required. Thanks for the feedback 😉
November 30, 2020 at 4:49 pmI’m running PHP 7.4.9 on my local server. I’d already tried with previous versions of PHP, but still the same.
November 27, 2020 at 2:02 pmI try your setcookie changes, but this doesn’t solve the problem unfortunately.
Any other ideas ?
Make sure permissions allow for writing to the migration folder. Also watch your logs for clues.
November 27, 2020 at 2:28 pmHi,
November 27, 2020 at 9:19 amI’m trying to migrate an old 2.2 OSC database to a Phoenix version.
Your migration module is on my local server, as the old OSC installation and the new empty Phoenix one.
I can access the first step to define the tool password, but I’m stuck on the login screen which loops without loading any further step.
What am I doing wrong ?
You should be running PHP >=7.3
If you are not, you could change the following, but I would recommend upgrading php 😉
If using PHP 7.2 or lower:
You could edit the code and change the 2 setcookie areas in header.php to use this instead:
setcookie( ‘zip_migration_pw’, ‘logout’, time()+3600);
setcookie( ‘zip_migration_pw’, $cookievalue, time()+3600);
Zip
November 27, 2020 at 1:24 pmHi,
October 10, 2020 at 6:55 pmI tried the migration tool and it looks very promising. Shouldn’t you, however, limit tables to be migrated to a specific schema? I have several db’s not related to OSC. I made the following changes in steps 14 and 15.
//ORIG$query = mysqli_query( $db, “SELECT table_name FROM information_schema.tables WHERE TABLE_SCHEMA!=’information_schema'” );
$query = mysqli_query( $db, “SELECT table_name FROM information_schema.tables WHERE TABLE_SCHEMA='” . $config[‘mysql_osc’][‘db’] . “‘” );
Good idea. In my testing I never considered that the user/pass for the database would have access to multiple databases. I will have a look asap and adjust 😉
October 10, 2020 at 7:46 pmAdded this in version 0.1.6
October 13, 2020 at 5:13 am