Tutorial: Convert FoxPro Database To MySQL

Dr. Thomas E. Hicks
Scott Schwartz
Research By Mark Silliman & Kevin Stansell

Computer Science Department
Trinity University

 


Download The DBManager Freeware Application

1] Navigate browser to http://www.dbtools.com.br/EN/ . Download the transfer tool that is used here to transfer a fox pro database into MySQL.  (See Below!)

DBManager\prosetup200.zip
[For Trinity Students Only!]
 


2) Select the DBManager Professional Freeware (2.0a). Enter the specified information. Using the mouse, select push Get The File Loaction button.


3) Select USA. (See Below!)


4) Using the mouse, select/push the Download Now button.
(See Below!)


5)
Using the mouse, select/push the Save button. (See Below!)

6) I download all applications to the Software directory. As you can see below, I have created a folder, called DBManager in which to place the download.  (See Below!)

7)  Using the mouse, select/push the Save button. (See Below!)

8) The download time will vary with the connection. (See Below!)  If you get an install error, ignore it!



Install The DBManager Freeware Application

1) As you can see, file prosetup200.exe has been downloaded to the C:\Software\DBManager folder. Using the mouse, double-click on the application icon. (See Below!) 

2)  Using the mouse, select/push the YES button. (See Below!)


3) 
Using the mouse, select/push the Next button. (See Below!)


4) 
Read the license agreement and respond accordingly. If you accept, select/push the Next button. (See Below!)


5) 
Using the mouse, select/push the Next button. (See Below!)


6) 
Enter a UserName and Organization. Using the mouse, select/push the Next button. (See Below!)


7) All software should be installed in the Program Files directory, if possible. Using the mouse, select/push the Next button. (See Below!)


8)  Using the mouse, select/push the Next button. (See Below!)


9)  Using the mouse, select/push the Next button. (See Below!)


10) Using the mouse, select/push the Install button. (See Below!)


11) Using the mouse, select/push the Finish button. (See Below!)



The FoxPro Database

1) We are starting with a FoxPro Database, called Rest.  (See Below!)

2) Part of the data may be seen in the browse window below.  (See Below!)

3) The Rest database layout is as folows: (See Below!)


  

4) A copy of this database may be downloaded.  (See Below!)

rest.zip


Convert The Database
1) Using the mouse, hold down the Start Menu --> Select DB Tools Software --> Select DB Manager Professional --> Select DB Tools Manager Professional.  (See Below!)

You may also launch DB Manager Professional by double-clicking  the desktop icon!


Note:
If You have already created a connection with a server, you need not do steps 2 through 7 involving creating a connection which follow.  Instead, go directly to step 8 of this section.

2)  The DB Manager will start. Using the mouse, hold down the Tools Menu --> Select Server --> Select Server Manager  (See Below!)


3) Using the mouse, select the New button. (See Below!)


4) Select MySQL server type. Enter your server/computer Name. Enter the Hostname [localhost will suffice]. Enter a valid UserName and Password On That Server which has access perniisions to MySQL. Enter the MySQL port [3306 unless you have altered the default configuration]. Enter the MySQL Engine Version.

Using the mouse, select the Save button. (See Below!)


5) Using the mouse, select the Server in the properties window on the left. Using the mouse, select/push the Test button. (See Below!)

6) We have a connection. Using the mouse, push/select the OK button. (See Below)

7) Using the mouse, push/select the Yes button to reload the servers. (See Below)

8) After selecting Yes in the previous step, you will be returned to the DBManager main screen.  Using the mouse, right click on  your connection in the WorkSpace window and select the Connect option.  The Connection is now running, and you should see the green play icon next to the server instead of the stop icon. Note the connection in the Message window.  (See Beleow)


9) We are connected. Using the mouse, hold down the Tools Menu bar --> Select Data Management --> Select Import/Export Wzards.  (See Beleow)


10) Using the mouse, touch to select the MSDAO Import Data option and, use the mouse to click ok.  (See Below)


11) In the Source scroll down box, select the type of database you wish to convert into a database on your MySQL server.  (See Below)


12) Enter the path to the Database you want to transfer to MySQL in the Folder field [We have used C:\Rest as shown above in the FoxPro Section of this tutorial].  Then use the mouse to Select Next (see below)


13) Use the Mouse to touch/select the Database(s) you want to convert to MySQL and use the mouse to click next.

14) Adjust the names names of the Source and Target Tables if necessary (by clicking the text field and changing the name as you would like) and select Next. (See Below)

15) Type in the name for the Database that will appear in MySQL as a result of the transfer. If you would like a log of the transaction, check the Create LogFile and specify where you would like it to be saved in your computer. Click Next When you are ready.  (See Below)


16) With the mouse, Select Finish to start the transfer, and get your new database in MySQL format!


17) You will receive a conformation screen.  Use the mouse to click OK to finish.



Verify that the transfer worked

1) Using the mouse, hold down the Start Menu --> Select Run.  (See Below!)

2) Using the mouse, click in the text field Open:.  Use the keyboard to type in cmd to open the command line so we can get to MySQL.  Again use the mouse to select OK.  (See Below!)

3) Using the mouse, click in the text field Open:.  Use the keyboard to type in cmd to open the command line so we can get to MySQL.  Again use the mouse to select OK.  (See Below!)

4) Once in the Command Line, navigate to your MySQL bin folder, so you can run the MySQL command line interface.  [Here, we navigated with cd c:\program files\mysql\bin].  After you have typed in the path to your MySQL bin folder, hit enter on the keyboard.  Then run the MySQL executable by typing mysql and hitting enter again.  MySQL welcomes you.  (See Below!)

5) Once in the MySQL environment, change to the database you transfered [Here, use Rest] as done below with the keys.  Then press enter.  So far so Good.  To see the tables that were transferred type the command, show tables; Everything seems to be in order.  (See Below)

6) The following MySQL commands will display the Transferred Database, here, just as it was seen in the FoxPro Environment.  The Transfer was a Success!  (See Below!)

7) You can also expand the Databases --> BusinessApp --> Tables --> Rest in the DBManager. Notice the Columns, Indexes, Foreign Keys, and Check Constraints folders on the right. (See Below!)

8) Double-Click on the Columns folder to see the database fields. (See Below!)

9) With the DBManager, you can also see the users, change the User Passwords, etc. Check it out!  (See Below!)


May be accessed through URL: http://www.cs.trinity.edu/~thicks
May also be accessed through URL: http://carme.cs.trinity.edu
This Document May Not Be Printed or Reproduced Without Written Permission.
 2003 Copyright : Dr. Thomas E. Hicks
Permission granted : Professional Educators & College Students may print one copy of this page!

Dr. Thomas E. Hicks

Computer Science Department    
Trinity University

"Dr. Web"