4. PHP MySQL Bridge Connection Settings
fmPreferences - fmBridgeConnection
Bridge is just another way to connect to your database. Usually, the program uses direct MySQL connection to remote database installed at 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 may prevent connection from being established. Bridge allows you to work with remote database without direct MySQL connection established.
While working through bridge you must store your temporary data somewhere in the local database. Bridge is used only for two major operations - getting data from remote database and posting data to that database. You must understand the difference between bridge
connection and MySQL connection. Bridge is not a connection itself, actually this is just a way to transfer files between remote and local machine and nothing else.
To configure PHP MySQL Bridge Connection, follow a few steps listed below:
1. Download the latest version of PHP MySQL Bridge here (recommended) or open your application main directory - usually it is "C:\Program Files\eMagicOne\Store Manager for ... " and find directory "Service" there. Inside this directory you can find bridge.php file.
2. Important. Edit bridge.php file - change default user name (default username is 1) and password (default password is 1) to keep your store protected.
Open bridge.php file (you can open it using NotePad or WordPad) and find the following lines there:
$username = "1";
$password = "1";
Put your own values instead of "1" in both lines. 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.myonlinestore.com/bridge.php, where - http://www.myonlinestore.com represents your store link.
Tip: Also it is recommended to run Bridge.php Self Test. It checks your website to make sure that there are no problems with your hosting configuration. Your hosting support can solve all the problems found there.
Important note: bridge.php file should have the following privileges - Owner: Read, Write; Group: Read; World - Read (ch-mod 644)
Also in case you have any issues with connection, please create a tmp folder in your store Root with all privileges (ch-mod 777) and open bridge.php file to uncomment the following line:
//$temporary_dir = "./tmp"; // on some systems if you get output with 0 size, try to use some local temporary folder
1. uncomment this line - remove two slashes at the beginning
2. connect to your store via FTP and upload modified file there - all the other actions should be made on your store server
3. create directory "tmp" in the same folder, where bridge.php placed and assign access rights for all groups
Try to perform some actions in Store Manager through bridge, if everything was set properly it should work well.
4. Open Store Manager -> Tools -> Preferences and enable PHP MySQL bridge connection check-box.
5. Specify the following PHP MySQL Bridge and Local Database Connection Settings:
- Bridge URL - Specify Bridge URL, it should look like http://www.myonlinestore.com/bridge.php, where http://www.myonlinestore.com represents your store URL.
- Username and Password - Specify those you used to define above (see step 2).
- Database Name - Specify local database name (type name manually) or select one from the drop-down using browse button .
Tip: Use Test Connection button to verify if all settings are correct.
Note, that it is not your live store database, it is your local database used to work with your data locally. In order to see your live store data you need to Get Data from Web, either using Tools -> Database Bridge -> Get Data from Web or using the corresponding Action.
Wait while the data are transfered. Depending on database size and connection speed the process may take from a few seconds to several hours (large database + slow connection). Follow the steps of Backup/Restore wizard. Now you may work with your store - add/modify products, categories, import products etc.
It is important to post all the changes you have made to your online store. Select Main Menu -> Tools -> Database Bridge -> Post Changes to Web or use the corresponding Action. This action will post all commands stored in Pending Bridge Data section to bridge.php installed on your store. When Bridge receives the file, it will execute all commands one-by-one in order as they were stored/made. After all commands executed successfully, your remote store will reflect all the changes that you have made locally.
Also you can Clear all Changes (this action will clear all the commands), but pay attention that you won't be able to undo this action.
Note: If you wish to create 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, then Store Manager may ask you to create one.
Note: Local database and your store database are two different databases and their names may be either different or the same. It won't affect in any way connection settings.
Tip: Use Bridge.php Self Test Tool to check your website and to make sure that there are no problems with your hosting configuration. Your hosting support can solve all the problems found there.
6. Click Ok to save this entry, close Preferences and connect to your database, or click cancel to discard this entry.
Also you can make Database backup/Restore selecting the corresponding action from the drop-down.
6. Click OK to save changes and close preferences. Now you have to retrieve data from your web store into your local database.
7. In main application window - Main Menu->Tools->Database Bridge->Get Data from Web.
8. Select Main Menu->Tools->Database Bridge->Post Changes to Web. Check whether all changes you made were reflected on web store properly.
If you have difficulties with "tmp" folder please check this article for help.
Note: It is strongly recommended to create database backup before performing any mass operations which may be potentially unsafe.