Post by tmblue » Sat Mar 21, 2009 12:53 pm

I cant restore what i've backed up. It alway show a error:

Code: Select all

Error: 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 'TRUNCATE TABLE `category` INSERT INTO `category` (`category_id`, `image`, `pare' at line 4
Error No: 1064
TRUNCATE TABLE `address` TRUNCATE TABLE `category` INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES ('44', '', '36', '9', '2009-03-20 22:00:50', '2009-03-20 22:00:50')
does it has any mistake ?

Newbie

Posts

Joined
Fri Mar 20, 2009 6:46 pm

Post by JNeuhoff » Sat Mar 21, 2009 10:05 pm

I can't reproduce your error, just tested the Backup and Restore function on Opencart 1.2.0, and it is working fine. Are you using a backup.sql created from a previous Opencart version? There were some database changes between Opencart releases 1.1.8 and 1.1.9.

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by tmblue » Sun Mar 22, 2009 12:07 am

no, i updated to the v1.2.2. After then, i backuped and restored right after and it didnt work...
Or mysql has an error ???

Newbie

Posts

Joined
Fri Mar 20, 2009 6:46 pm

Post by JNeuhoff » Sun Mar 22, 2009 2:21 am

Strange. Looking at your example, I can see there are missing semi-colons. It should have done something like this:

Code: Select all

TRUNCATE TABLE `address`; TRUNCATE TABLE `category`; INSERT INTO `category` (`category_id`, `image`, `parent_id`, `sort_order`, `date_added`, `date_modified`) VALUES ('44', '', '36', '9', '2009-03-20 22:00:50', '2009-03-20 22:00:50');
Are you sure you are using a backup.sql as generated by Opencart's

Admin > Configuration > Backup / Restore > Export (or Backup) ?

Because the one generated from Opencart's Backup doesn't contain any TRUNCATE TABLE statements at all!

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Daniel » Sun Mar 22, 2009 5:03 am

Sorry guys. i missed a ; at the end pof the trunicate statement.

I will release another fix tonight.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by JNeuhoff » Sun Mar 22, 2009 5:10 am

Daniel, where exactly does it use the TRUNCATE TABLE statements? From what I can see in the 1.2.0 release, it uses DROP TABLE IF EXISTS ....; CREATE TABLE....; statements.

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Daniel » Sun Mar 22, 2009 5:26 am

I think your looking at the install script.

First off i made a few mistakes int he last few release when installing a new version it came up with DROP if exists or somthing like that.

To start fresh each table needs to be dropped.

For backup and restore

this

TRUNCATE TABLE `address`

should have been this

TRUNCATE TABLE `address`;

So if you are having problems backing up and resotring you need to add the ;

this will be fixed int he next release.

I'm trying to get the latest releases stable with no bugs so I can start adding more features and release at a slower pace.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tmblue » Sun Mar 22, 2009 9:28 am

JNeuhoff wrote:Daniel, where exactly does it use the TRUNCATE TABLE statements? From what I can see in the 1.2.0 release, it uses DROP TABLE IF EXISTS ....; CREATE TABLE....; statements.
i think that backup method must be in 1.1.x version...

Newbie

Posts

Joined
Fri Mar 20, 2009 6:46 pm
Who is online

Users browsing this forum: No registered users and 11 guests