Jump to content
thirty bees forum
  • 0

Questions about migrating a single shop from multistore to a standalone TB


Question

Posted

Hello Thirty Bee community,

I have a question about the migration on TB. We are currently using a PS 1.6.1.4 on multistore (with 5 shops on it), and I was thinking about moving one of the shop out of the multistore and put it as a solo ThirtyBees store. Since the shop had literally a dozen oneshot orders last year, I'm not worried about importing customers and orders data. However I would like to keep everything related to products products, products lang, attributes, combinations, categories, images, prices, etc.

Does anyone have any previous experience in this kind of migration ? What is the best process for doing so, import mysql tables directly or use a CSV module ?
Are there any "traps" aside of changing the "id_shop" number in the tables and maybe tables I forgot to mention ? Is there a better TB version where I should import those products and then make the update using the GitHub updater ?

Thank you by advance for your time and answers.

7 answers to this question

Recommended Posts

  • 0
Posted

I would create a test copy of the front end and the database, disable multistore, manually remove all other shop data from tables in the database and then do a migration.

We did something similar successfully but don't have the steps written down now.

  • 0
Posted

I'd clone all five shops, then remove the four unwanted ones in the clone. No need to have these five front offices web accessible, there's only one back office.

Trying to manipulate database contents directly would be a pretty complex thing. There are all kinds of connections between tables, finding them is really hard.

  • 0
Posted

Hello,

I've managed to get my hands on the problem more seriously in the past two weeks, so here is a note on how to disable multistore. As usual, if you have comments or better workarounds than those steps, I'll gladly edit the steps 😉
Hope this will be useful to some of you :

 

Disclaimer :
The aim of this procedure is to delete shops from the multistore and allow you to revert back to a single shop. Some steps will need you to delete customers, addresses and orders. If you are using Prestashop / Thirty Bees as the only way to keep traces and record of your orders, make sure you have a backup somewhere in order to comply with your country regulations. Also I didn't have time to test much of my shops after applying this solution, so there might be bugs related to this. So please take this into consideration before applying this, especially on a live shop...
 
1st part - Make a proper copy on local
 
1) Make a copy of your ftp on a local wamp
 
2) Import database in phpmyadmin or with bigdump if like mine it's too heavy
 
3) In mywebsite/config/settings.inc.php change the fields to these (those are for a default wamp)
 
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'mydatabase');
define('_DB_USER_', 'root');
define('_DB_PASSWD_', '');
 
4) Make the following changes on the ps_shop_url table at the line of id_shop 1 :
 
domain : localhost
domain_ssl : localhost
physical_uri : /mywebsite/
 
 
5) Delete the content of the cache folder
 
6) Open your back office and you should have it up and running. If you're not seeing any CSS, you most likely have made an error in changing the table ps_shop_url. If that's the case repeat step 5 to 7 until CSS and JS are loaded properly. (Idealy disable and delete the cache before making your backup, you'll gain some time.)
 
 
2nd part - Deleting the multistores
 
In order to delete a shop in multistore and avoid the : "You can’t delete this shop (customer and/or order dependency)." ; you'll have to follow these steps
 
1) Use this Mysql query on phpmyadmin :
 
DELETE ps_orders, ps_order_detail FROM ps_shop, ps_orders, ps_order_detail
WHERE ps_shop.`id_shop`= X
AND ps_orders.`id_shop`= ps_shop.`id_shop`
AND ps_order_detail.`id_order`= ps_orders.`id_order`
You must replace the `id_shop`= X with the ID of the shop you want to delete. I found this query here :
 
2) Once all orders are deleted, you will need to delete all of your customers and related data. For that, go to your customer page in the back office, display them by 1000 and then select all and delete. You'll need to check the option to delete all data related to customers. Deleting 1000 accounts take around 10 minutes. For this specific part be careful to delete only the customers from specific shops and not all of them. I haven't done this with the feature "single account for several stores" activated, so I don't know how it will behave in that specific case.
 
3) Repeat step 2 for the adresses
 
4) Make a jump in PhpMyAdmin and empty all tables related to orders (like invoice), addresses, and customers. There my be some leftovers not shown in your back office. Exemple we had a hidden customer generated by the One Page Checkout module of PresteamShop.
 
4) Go to the multistore tab, once the page is loaded change the default store for the one you want to keep
 
5) Delete your unwanted shops in advanced parameters -> multishop.
 
6) Go to the global parameters and disable the multistore feature.
 
7) Create a front office account and make a test order. You should notice that your ID orders will start anew with ID 1, while your customers ID and addresses will stay where left.
  • Like 1

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