Jump to content

Manual Database Transfer Guide (Temporary)


Guest

Recommended Posts

This is only a temporary guide until a proper exporter is released; I can't guarantee this will work, and make sure you have backed up your Database's before starting. I will add to this as I go along with transferring my DB from CC2 DB to CC3. :lol:

I would only advise doing this if you are comfortable with phpMyAdmin, or at least have an understanding of how to use it. - Good Luck!

How to transfer the Category's

Start by creating a new temp Database base (Im using Localhost as its a lot quicker to work with, and then export your CC2 Category Table to the new temporary DB (I did this via a SQL query).

View the category table structure, and edit the the first field name (Category), to cat_name, do this by simply selecting the little pencil symbol to the right of the last column (First to the left of the red X); when the edit page loads just rename the Field Name and press Save.

Next we need to add a new field, you can do this through the Structure page. After the last row there is a 'Add new Field:' area with a drop down box and a 'Go' Button; Press Go.

You will then be presented with a new page with a number of boxes in a line, such as Field, Type, Length/Values* etc.

Enter the following, leave the other ones as default if not mentioned:

Field: noProducts

Type: Int (Drop Down Box)

Length/Values*: 11

Null: null (Drop Down Box)

Default**: 0

Once entered click save.

If you have any extra information stored in your Category's this would be the time to either update your CC3 DB to reflect the extra fields, or remove them from your CC2 DB. All we need to do now is simply Export our edited Category Table, do this by selecting the 'Export' Tab at the top of phpMyAdmin, deselect the Structure option and click 'Go'.

The page should change to display the SQL output, select all and copy it to a notepad (we only want the insert lines). All we have to do is a simple search & replace. Start by changing the table name from (prefix)_category to cubecart_category, and then do a search for 'catnophoto.gif', and replace it with nothing.

To finish of, copy all of the text from notepad and run it as a SQL query in your CC3 DB using myPhpAdmin.

How to transfer Cubecart2 Customer's

For this section ive created a small PHP file to do most of the work for you, if you download the script (customer_export.php attached to this post), open up the file and update the Database information to reflect your Cubecart2 shop. Then either run the script from your website or localhost, it will output a SQL query.

Copy then run as a SQL script in phpMyAdmin in your Cubecart3 Shop Database.

If it comes up with an error of 'Invalid Identifer @ XX', it tends to be caused by a person's name, or address holding an extra ', which is confusing the SQL query, simply go to the line that the identifier is pointing to and check for any errors.

customer_export.php

Link to comment
Share on other sites

Ive done a quick update to the first post, adding a customer export script. Should work fine accept your customer won't have a title unless they update it themself (Mr/Mrs/Miss). First & second name should automatically be split from the whitespace of the original name field.

I will try and update the Category transfer with a similar php script.

Regards,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...