Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I backup just the products?


teglet

Recommended Posts

Hi All,

 

I have two OSC sites the first is fully stocked and has many mods including Database Mods. And hundreds of products customers orders etc.

 

The second site is the latest stable version of OSC with a few mods to make it suitable for UK ie Credit Cards, Address format etc. This second site has the standard database which is empty. of products.

 

I want to know how I can backup just the products, images, and product attributes from the first site and insert them into the 2nd (new) site database without backing up all the other things like customer details etc and order history.

 

I have no idea how to do do a selective backup and DB import so I would need it talking through step by step. I tried to do a simple backup from site 1 which I put on my hard drive then went to site two and tried to restore through admin. But this restored all of the DB mods that I have made aswell and crashed the siten so I am guessing that is not the way to do it :'(

 

FYI the databases will reside on the same server and I have PHPMyAdmin installed which allows me to access and edit the DB's

 

My Objective is to make one UK ready site pre-stocked with my products which I can then copy in full and give to each of my regioanl distributors who can add there own regional products.

 

Help here would be gratefully appreciated.

Link to comment
Share on other sites

Open the backup.sql file in a text editor and strip out all the stuff you don't want to go into the new db. Then you would be left with query blocks like:

 

insert into products (products_id, products_quantity, ....etc);

 

Then compare that to the new db to see what has been added. e.g.

 

Modded Table

insert into products (attribute_a, attribute_b, attribute_x, attribute_c) values ('value_a', 'value_b', 'value_x', 'value_c');

 

New Table

insert into products (attribute_a, attribute_b, attribute_c) values ('value_a', 'value_b', 'value_c');

 

Remove attribute_x and 'value_x' and you should be ok. On the other hand if attribute_x has replaced attribute_d, it will need more thought.

 

Once you have done all that, save what you have left as products.sql and run it as a SQL query on the new db, from phpmyadmin. Fingers crossed and if the wind is blowing in the right direction, you should have a working, populated db.

 

Before you do anything, make copies of all files you are going to change. If something goes wrong, no copy = no recovery!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...