1.6 PHP MySQL Bridge Connection


This section describes how to setup Bridge connection in Store Manager for WooCommerce.

The bridge is just another way to connect to your PrestaShop database. Normally program uses the direct MySQL connection to remote database installed on the website or some other web server. In some cases this type of connection does not work - your hosting provider may not allow direct connections or your LAN settings/firewall prevent the connection from being established. The bridge allows you to work with the remote database without direct MySQL connection established.

While working through bridge you must store your temporary data somewhere in the local database. Bridge.php is used only for two major operations - get data from the remote database and post data to that database. You must understand the difference between bridge connection and direct MySQL connection. Bridge.php is not a connection itself, actually, this is just a way to transfer data between remote and local machine and nothing else.

To configure PHP MySQL bridge connection, follow few steps:

1. Download the latest version of PHP MySQL Bridge here (recommended) or open your application main directory - usually, it is "C:\Program Files(x86)\eMagicOne\Store Manager for ... " and find directory "Service" there. Inside this directory, you can find bridge.php file.

Bridge php file

2. Edit bridge .php file


We strongly recommended change default username (default username is 1) and password (default password is 1) to keep your store protected.

Open bridge.php file (you can open it by using NotePad or WordPad) and find the following lines there:

$username = "1";

$password = "1";

Put your own values instead of "1" in both lines and do not forget to save the changes.

Bridge credentials in file

Also here you can find how you can make Bridge connection more secure.

You may keep all other settings as they are unless you have any errors.

3. Copy bridge to your online store root (catalog) directory. Bridge should be accessible as http://www.onlinestore.com/bridge.php whereas your store link is http://www.onlinestore.com.

4. Open Store Manager -> Settings tab -> Preferences (F12) and enable PHP MySQL bridge connection checkbox.

Bridge connection setting details

5. Specify the following PHP MySQL Bridge and Local Database Connection Settings:

  • Bridge URL - Specify Bridge URL, it should look like http://www.onlinestore.com/bridge.php whereas your store URL is http://www.onlinestore.com.
  • Username and Password - Specify those you used to specify in bridge.php file (see step 2).
  • Database Name - Specify local database name (type name manually) or select one from the drop-down using 'Select Database' button. If you do not know what is your local database name, simply specify local_database and hit OK to create a new one.
  • Note: Local database and your store database are two different databases and their names may be different or may be the same, it doesn't matter.
  • Note: If you wish to create the new local database you can type its name manually and use test connection button. You'll see the notification that local database with specified name does not exist and Store Manager may ask you to create one.
Create and Get data from the Web

Tip: Use Bridge Self Test tool to check your website and to make sure there are no issues in your hosting configuration. Your hosting support can solve all problems found there.

Bridge Self Test

Tip: Use Test Connection button to verify if all settings are correct.

Bridge Test Connection

6. Click Ok to save this entry, close Preferences and connect to your local database, or click cancel to discard this entry.

Also, you can use Database Connection wizard to set up your connection as well.

connection wizard

7. Now you have to retrieve data from your web store into your local database.

Go to Tools -> PHP MySQL Bridge -> Get Data from Web (CTRL + G). Wait while data is transferred.

Get data from the Web

Depending on database size and connection speed it may take from a few seconds to several hours (large database + slow connection).

Follow a few steps of Backup/Restore wizard. Now you may work with your data - add/modify products, categories, import products etc.

Note: It is strongly recommended to make a full database backup before you proceed. You can make a backup using Tools -> Database Backup/Restore wizard.

8. It is important to post all changes that you have made to your remote database to see them at your online store. Select Tools -> PHP MySQL Bridge -> Post Changes to Web (CTRL + P).

Post changes to Web

or use the corresponding option in Database Connection section in Preferences.

Post changes to the Web in Preferences

This action will post all commands stored in Pending Bridge Data section to bridge.php installed at your store.

Pending Bridge Data

When a bridge receives the file, it executes all commands one by one in order as they were stored/made locally. After all, commands are executed successfully, your remote store will reflect all changes you made locally.

Also, you can Clear all Changes (will clear all commands) made locally before posting if you do not want them to be applied to your remote database.

Clear changes

Pay attention that you won't be able to undo this action.

9. Check whether all changes you made were reflected on web store properly.

Note: It is strongly recommended to create the database backup before any mass operations which may be potentially unsafe.