This simple script reads your mivadata/merchdb.dat mivasql database definition file (ex: from Miva Merchant) and converts the mivasql database to mysql. The mysql target database should already exist, as well as a mysql user with proper permissions to connect, create, alter, index, insert, delete, etc.
WARNING: ALL DATA IN THE TARGET MYSQL DATABASE WILL BE LOST AND REPLACED BY DATA FROM THE SOURCE MIVASQL DATABASE. YOU HAVE BEEN WARNED! MAKE A BACKUP FIRST!
NOTE: As a simple failsafe, calling this script again (after you change your store merchdb.dat configuration file to point to MySQL) will NOT re-run the conversion. It will bail - saying you have already converted.
NOTE: Put store in maintenance mode before running this - and better yet also do the conversion in Miva Mia offline so no data changes during the conversion. Additionally, we recommend performing store maintenance by deleting baskets and packing data.
How to convert Miva Merchant 5 from MivaSQL to MySQL:
1. Copy your mivadata/merchdb.dat file to mivadata/mysqldb.dat. Edit the mysqldb.dat file to reflect your new MySQL configuration.
- merchdb.dat probable looks like this: mivasql|mivamerchant.dbf|||
- change mysqldb.dat, to replace the connection string with: mysql|mysql_database@mysql_server|mysql_username|mysql_password|
2. Set your MivaVM/Empresa timeout to zero.
3. Place this script (mivasql2mysql.mvc) at the root of your httpdocs directory, and load it with a web browser. ex: http://www.yoursite.com/mivasql2mysql.mvc?go=1
4. Grab a cup of coffee.
5. Assuming all went well, all of your MivaSQL database table structures, indexes, and data have been transferred to MySQL. Now just change your mivadata/merchdb.dat file to run your store from the MySQL database:
- rename merchdb.dat to mivasqldb.dat as a backup
- rename mysqldb.dat to merchdb.dat