Jump to content
thirty bees forum

merge 2 shops 1


Havouza

Recommended Posts

Yes it's possible. At least I think so. I have started this project (for my company), but not totally finished it. In general I looked for all db tables with id_shop or similair columns. Then I wrote some helper functions, how to merge them. Cause sometimes you want to hold the information, sometimes just delete it.

Example:

  • ps_orders you surely want to hold, so you just rewrite the id_shop from 2 to 1
  • ps_product_lang you want to check, if the product was already existing in shop 1. If yes, you probably just want to delete the rows for shop 2, otherwise you probably want to rewrite 2 to 1.

All this worked fine for me. But honestly, I haven't finished the project yet. In my BO I still have the 3 shops. But not because I fear any issue. I just didn't have time to finish this project cleanly.

Maybe @datakick can shortly answer, if he sees any potential problem with my advise!?

Link to comment
Share on other sites

As @wakabayashi wrote, it's somewhat simple to reduce multistore to a singlestore. You need to make sure that all db records are assigned with target shop first. Check all *_shop tables, and *_lang tables and that contains id_shop column, are associated. Once all records are associated, delete the source shop. There shouldn't be an issue.

List of related tables:

SELECT table_name 
FROM information_schema.tables t
WHERE table_schema = database() 
  AND (
  	(table_name like '%\_shop') OR 
  	(
  		table_name like '%\_lang' AND 
  		EXISTS (SELECT 1 FROM information_schema.`COLUMNS` c where c.TABLE_NAME = t.`TABLE_NAME` and c.`COLUMN_NAME` = 'id_shop')
  	)
  );

If you have two stores in separate installations (not multistore), then it would be much more complicated. You would have to probably use data export and import.

 

Link to comment
Share on other sites

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...