Jump to content

Restoring old Database with Prestashop Version 0.9.7.2 - 0.219s


Recommended Posts

Ok, I'm in a pickle.

Yesterday I tried to upgrade version 0.9.7.2 to 1.0.0.whatever. This was unsuccessful. I backed up our database with godaddy's backup system and it outputs it to a .sql file, which has thousands of products in it and ton of man hours invested in it.

Since the upgrade was unsuccessful (we wont elaborate on why it wasn't right now), I removed all of the prestashop files, and put a clean version up, installed it, then changed the database settings to the old database.

Prestashop, for some reason is still using the old database (all of the old iPod stuff) and will not add the categories, and thousands of products into the new shop.

I need this running ASAP. Basically, I need to know why its not showing any of the old product.

Link to comment
Share on other sites

How I would do it.

1) Install a clean version of 0.9.7.2 or put back the files from your "saved" version (you did take a backup of all the files didn't you!).
2) Point this install at the database you want to repair and then use.
3) Drop all the tables in the database you want to repair, and then import the 0.9.7.2 database backup into it.
4) If you used a new install in (1), then request new passwords before panicking about not being able to log in :)
5) Your shop should be back to the way it was.

Paul

Link to comment
Share on other sites

I think I've tried this about a hundred times, actually.

I have a backup of all of the old files and they all work, but for some reason the database is not coming up on the new installation.

Also, my php/mySQL knowledge is limited. I have the old SQL database, but when I "restore" it, it doesn't do anything, I'm still stuck with the old products. GoDaddy has phpMyAdmin but anytime I try to restore the database from there the file is too large. And when I "ZIP" it, phpMyAdmin doesen't accept the file because: "You attempted to load file with unsupported compression (application/zip). Either support for it is not implemented or disabled by your configuration."

The restore is there, the products and manufacturers are there, prestashop just isn't "Seeing" the product?

Link to comment
Share on other sites

Ah right.

You need to drop the tables in the database, as the import may try to create them (depending on the backup settings). I find it's less confusing to do that anyway.

The problem with the sql file being too large is a common one! I use 7-zip which seems to create files that are understood just fine, but it pepends on you hosting and phpmyadmin version I guess. However, all is not lost. The .sql file you have is just a text file, and it will have each table, plus it's data in it. Grab yourself a text editor, and get splitting that file up until you get it down (in chunks of whole tables) into sizes that you can upload, and you're off and running again.

An example of a "chunk you want to split into a new file would be:

-- --------------------------------------------------------

--
-- Table structure for table `ps_category`
--

CREATE TABLE `ps_category` (
 `id_category` int(10) unsigned NOT NULL auto_increment,
 `id_parent` int(10) unsigned NOT NULL default '0',
 `level_depth` tinyint(3) unsigned NOT NULL default '0',
 `active` tinyint(1) unsigned NOT NULL default '0',
 `date_add` datetime NOT NULL default '0000-00-00 00:00:00',
 `date_upd` datetime NOT NULL default '0000-00-00 00:00:00',
 PRIMARY KEY  (`id_category`),
 KEY `category_parent` (`id_parent`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=74 ;

--
-- Dumping data for table `ps_category`
--

INSERT INTO `ps_category` VALUES(1, 0, 0, 1, '2008-07-17 17:35:13', '2008-07-17 17:35:13');
INSERT INTO `ps_category` VALUES(2, 1, 1, 1, '2008-10-19 01:37:30', '2008-10-19 01:37:30');
INSERT INTO `ps_category` VALUES(3, 1, 1, 1, '2008-10-19 01:37:31', '2008-10-19 01:37:31');
INSERT INTO `ps_category` VALUES(4, 1, 1, 1, '2008-10-19 01:37:32', '2008-10-19 01:37:32');
INSERT INTO `ps_category` VALUES(5, 1, 1, 1, '2008-10-19 01:37:33', '2008-10-19 01:37:33');
INSERT INTO `ps_category` VALUES(6, 1, 1, 1, '2008-10-19 01:37:34', '2008-10-19 01:37:34');
INSERT INTO `ps_category` VALUES(7, 1, 1, 1, '2008-10-19 01:37:40', '2008-10-19 01:37:40');
INSERT INTO `ps_category` VALUES(8, 1, 1, 1, '2008-10-19 01:37:42', '2008-10-19 01:37:42');
INSERT INTO `ps_category` VALUES(9, 1, 1, 1, '2008-10-19 01:37:44', '2008-10-19 01:37:44');
INSERT INTO `ps_category` VALUES(10, 1, 1, 1, '2008-10-19 01:37:46', '2008-10-19 01:37:46');



This will then repeat (in the original file that is) with the next table.

I suggest you use something like wordpad, or the file will be too large/corrupted by the editor/garbled.

Hope this makes sense!

Paul

Link to comment
Share on other sites

I can't believe I'm saying this, but I figured it out.

The database tables had a prefix of "prs_" and not "ps_" which added the old product. I can't believe I've worked this long and didn't see this before.

Thanks for all of your help, but alas, human error prevails!

I need the facepalm.jpg and a cigarette.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...