Forums / Upgrading from 1.3.x to 1.3.9 / how to get my v1.38a db contents into my new 1.39 upgrade?

how to get my v1.38a db contents into my new 1.39 upgrade?

Locked

Started by drunkguy on 24 Dec 2010, 2:36 AM · Views: 5,498

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
24 Dec 2010, 2:36 AM
#1
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

how to get my v1.38a db contents into my new 1.39 upgrade?

Im planning to upgrade from 1.38 to 1.39h.
I have installed 1.39h to a temp dir with a new blank db and have a copy of the current db on my pc. I dont know mysql at all AND its GoDaddy shared hosting.

  1. Exactly how do I get the all the tables and stuff INTO the new database?

  2. Im also planning to reinstall the mods and make any other customizing again since they are just a few and I think it will eaiser and safer than merging.

  3. Should I install the mods BEFORE I try to copy the current db contents to the new db or can I reinstall the mods after?
    I think most of the mods will be compatible with 1.39h but not sure of course.

Im pretty comfortable editing the config files and can look at the live sites settings if need be.

Thanks
:dontgetit

24 Dec 2010, 5:07 PM
#2
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

The thing to note is that phpMyAdmin can only import database backups of a certain size before it comes up against the Max Execution Time for php scripts. So if your database is much more than 1 Mb in size then it's unlikely that you can run it in using phpMyAdmin.

  1. But assuming that you can run it in:

a. Access the new blank database in phpMyAdmin.
b. Click on the Import tab.
c. Click on the 'Browse' box and locate the backup you took and are keeping on your PC.
d. Click the 'Go' button or similar in phpMyAdmin to begin the Import.

If it takes more than 1-2 minutes to import then it will probably end up showing just a few tables imported and may not show any error message at all. In this case the Import failed. There are then two options:

f. Break up the backup database into .sql files, each with no more than 1 Mbs worth of data in them, and then run them into the blank database in sequence (as described above).
g. If you know how to import a database using SSH then upload the database backup file to the root of your website and then login to SSH and import it. You can import any size of database using SSH.
h. If you don't know how to do this via SSH then upload the file to the root of your website and ask your hosting company to import it into the blank db for you. They'll need to know the name of the blank db and the User Name and Password assigned to it, as well as the name of the backup file and where you uploaded it to.

Be nice to them, because it's not their job to do this as part of hosting support, and be patient as it's now Christmas Holidays.

  1. Install the mods from new, checking to see if there are newer downloads which are certified for 1.3.9h.

  2. Only install them after you have the basic site up and running, and only if they have been updated to work with 1.3.9h. No point in installing them otherwise.

  3. Don't forget that after you have imported your 1.3.8+ database backup into the new blank db that you have to amend your configure.php files with the new info and then run the "Upgrade only database" link using /zc_install

Vger

24 Dec 2010, 11:34 PM
#3
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Thanks for the assistance Vger.

Before reading this I tried to import the db into the new and it popped an error, 1044 I think it was. A lot of the tables were imported but they appear to be empty. Note: I read another post on this subject and it said to make sure "add drop table" and "add if not exists" were checked during the export so I did that.

The sql backup db is 10+mb so as you say that may be an issue.
I think I can get SSH set up, I will look into that and try your suggestions if so.

If I have to split the sql file into 10 parts how do I do that.

Thanks again and Happy Holidays!

Drunkguy

25 Dec 2010, 9:29 AM
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

The BigDump: Staggered MySQL Dump Importer script should help in this situation.

The learning is in the doing.

Potent Products

26 Dec 2010, 7:08 PM
#5
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Thanks Website Rob.

I will give that a try.

:cool:
Drunkguy

9 Jan 2011, 7:26 PM
#6
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Okay I have made some progress. I managed to import the old DB contents into a new DB. I reran zc_install to upgrade the DB and had this error:

1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
in:
[CREATE TABLE counter_history_clean as SELECT * FROM counter_history WHERE 1 GROUP BY startdate COLLATE latin1_general_ci;]

which also shows a message that the DB needs to be updated to a higher level. Most everything was working okay on both the store side and admin.

In posts regarding the above error, Dr Byte suggests:
You'll need to edit the /zc_install/includes/installer_params.php file and change the DB_CHARSET from 'latin1' to 'utf8'.
Then the zc_install steps should run fine.

So I did this. The DB upgrade went well, no errors this time. I can access admin. All the customer data shows up but the store is blank!

The debug file says:
[09-Jan-2011 11:54:46] PHP Warning: require(DIR_WS_TEMPLATEStemplate_default/common/html_header.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/content/j/o/h/johnston09/html/aaa/index.php on line 43
[09-Jan-2011 11:54:46] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'DIR_WS_TEMPLATEStemplate_default/common/html_header.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/j/o/h/johnston09/html/aaa/index.php on line 43

All files appear to be in the correct locations.

Anyone see this before?

Thanks
Drunkguy:huh:

9 Jan 2011, 7:34 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Check the file at template_default/common/html_header.php that it is not a zero byte size and any others
You appear to have one or more file missing or corruot from your upload

Zen-Venom Get Bitten

9 Jan 2011, 9:26 PM
#8
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Hi Kobra.

the file at template_default/common/html_header.php exists and is 6K bytes.

As I said in my cry for help, the store was showing up (albeit default template) before the DB upgrade. the store files have not changed.
I have not installed any template in the new install. Could it be expecting the same template installed?

Thanks Kobra.
Drunkguy
:lookaroun

9 Jan 2011, 11:14 PM
#9
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'

You'll probably find that each table in the database backup you downloaded had entries which specified the default character set as latin_general_ci - which were then Imported into the new database.

You need to aceess the new db via phpMyAdmin and "Drop" all tables.

Then edit the backup you took and remove all entries that state something like "default character set = latin_general_ci" or similar.

Then reimport it into the new online db.

Run zc_install again to upgrade the db once more.

OR

Download a backup of the new db that has been upgraded and tick the box which says "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT", then remove all the latin_general_ci entries from the new backup, and then reimport.

Vger

19 Jan 2011, 1:46 AM
#10
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

I think I have figured out most of the upgrade/reinstall steps.
Most of my new site is working well, only problem seems to be "Best Sellers" which dont show up at all. From what Ive read in other posts "Best Sellers" are fetched from products sold. After importing and upgrading the DB, there is a difference in the products table between the 1.38 DB and the 1.39 DB and maybe that why it can display "best sellers"

Should there be a difference the table structer of "zen_products" in 1.39 DB or is it maybe a bad export of the old 1.38 DB?

Any Ideas?

Thanks
Drunkguy
:smile:

29 Jan 2011, 5:53 AM
#12
rod44 avatar

rod44

Zen Follower

Join Date:
Apr 2006
Location:
Homebase: Spokane, WA
Posts:
101
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

I am having a problem also with errors during database upgrades. I just upgraded from 1.2.7 to 1.3.9 basically without a hitch (forced to as ISP upgraded to SQL5 without any notice).... well almost....

I got the site installed in a demo dir, then imported the sql database from the old and all went fine. Then when I went to do the database updates it took the all except stopped leaving me a database ver 1.3.7. When I try to update again I get an error:

1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
in:
[INSERT INTO zen_query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');]

and am stumped. My store has been down for 2 days now there is a red banner across the top of the site that says "Your database appears to need patching to a higher level. See Admin->Tools->Server Information to review patch levels."

Help anyone, please???

Thanks so much,

Rod
:frusty:

Rod

Visit my Zen Site: Hat n' Patch

29 Jan 2011, 6:19 AM
#13
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Try re-importing your DB
Then upgrade one version at a time

Zen-Venom Get Bitten

29 Jan 2011, 9:01 PM
#14
rod44 avatar

rod44

Zen Follower

Join Date:
Apr 2006
Location:
Homebase: Spokane, WA
Posts:
101
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Thanks Kobra, I have tried to import the sql again and got timeouts, so split the file into 2 and tried again. 1st file went fine, 2nd ended in an error:

SQL query:

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

MySQL said: Documentation
#1298 - Unknown or incorrect time zone: 'NULL'

Is there a way for me to edit this to a correct setting or something? This entry was nowhere near where I split the file.

Thanks,

Rod
:censored:

Rod

Visit my Zen Site: Hat n' Patch

29 Jan 2011, 10:34 PM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Ask your host to dunp the current tables and insert your backup for you because you are getting a time out
Assuming your backup was created according to the tutorial I posted

Zen-Venom Get Bitten

29 Jan 2011, 10:37 PM
#16
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Remove all the lines at the beginning of the sql file starting with /*

Vger

4 Feb 2011, 7:05 PM
#17
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

If i use the sql backup-addon and make a backup of my 1.3.8 site... can i use that backup on a 1.3.9 site to get my customers and products to the new site?
Does 1.3.8 and 1.3.9h have the same db structure or do i need to change something in the db when using a 1.3.8 backup?

4 Feb 2011, 7:47 PM
#18
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

i should add that the new installation db has the "zen_" in the table names while the old does not

4 Feb 2011, 11:20 PM
#19
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

Although this was written for our customers most of this blog post should apply to you and shows you how to do the upgrade of the database.

http://www.terranetwork.net/blog/2010/11/upgrading-zen-cart-1-38-to-1-3-9/

Vger

5 Feb 2011, 12:15 AM
#20
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: how to get my v1.38a db contents into my new 1.39 upgrade?

But how do i deal with the bd if the old sore tables are "tablename" and the new db has the "zen_tablename"? is tehre a way to mod the backup file of the old db to add the prefix?