View Full Version : changing from ms2.2 to MAX 1.5.5

12-19-2003, 10:16 AM
what steps have to be taken to transfer my data base (over 4000 products) from ms2.2 to the new structures in the Max 1.5.5?

12-20-2003, 05:32 PM
Guess hep is only available to those that rent space here?

12-20-2003, 11:21 PM
Geotex, did you ever think it was the weekend before Chirstmas, and we have lives???? This is a 100% volunteer forum.

Sheesh, with that attitude, you are lucky I am in a good mood tonight. Usually I just ignore folks with bad attitudes.

What you need to do is make a copy of your database. Then make a new DB that has the default MS2MAX structure.

Then run mysqldiff (is included with the osCommerce and Max zip distros) to compare the copy you made with the MAX structure.

Then copy the output and save it to a sql file on your computer. Then, run that batch file on your copied db. This will update the structures. Then you need to import the MAX data into the new structures in your database copy. So, export the data from the admin, admin_groups, configuration, configuration_groups, all the affiliate tables, and any other tables that are in the max database, but not in your original, to a batch sql file again.

Then run that batch sql file on the copy.

That is it. Of course, you will most likely hit some snags along the way, like sql errors becuase the addressbook table may use a different primary key, etc, in which case you will have to manually alter the table structure and data to tweak it. This entire scenario assumes you want to keep your entire existing database.

If all you want is the products, run mysqldiff, and only use the sql that applies to the products tables. Then update the copy, and export the data. Then import it directly into the MAX database.

12-21-2003, 08:15 AM
Thanks for the reply. Sorry about the attitude. I do quite abit of volunteer consulting myself, so was really out of line.

Anyway, your instructions are clear, and straight forward. Thanks again for the input.

12-31-2003, 01:34 AM
Then run mysqldiff (is included with the osCommerce and Max zip distros) to compare the copy you made with the MAX structure.

Pardon my Perl-related disabilities - how does one run Perl scripts? I have access to the remote machine via PuTTY, but if possible I'd prefer to do the comparison locally (Windows, Apache, etc). If not, no big deal, I can do it remotely.

EDIT: Nevermind, got Perl working with the help of a friend. But now when running the ALTER SQL commands generated by the mysqldiff.pl, I'm getting this:

Incorrect table definition; There can only be one auto column and it must be defined as a key
ALTER TABLE address_book ADD PRIMARY KEY ((address_book_id))
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(address_book_id))' at line 1

I know you mentioned above that this might have to be dealt with manually, but I'm unsure as to what exactly is actually changing.

12-31-2003, 08:40 AM
I couldn't get the perl script to run or on the server due to data base security permissions (I'm on shared servers), or locally, on the Windows or Linux boxes (probably due due to my lack of knowledge of Perl). I compared the tables using mySQL Front, found the structures to be similar, then just emptied the tables I needed to transfer and uploaded an SQL file (no drop commands, just update) to populate all the products, customer and order tables. Left all the others populated with the MAX defaults. All seems to be working well, with no lost customers, orders, or products, passwords, addresses, etc.

12-31-2003, 11:49 AM
Geotex, :) That is the way all updates should be!

Sandwich, the problem is that you are trying to change the primary key to a field that has non-unique data. You will have to change the 'address_book_id' data to be unique numbers. Then you should be able to change the primary key to this field.