Main     News     Docs     License     Download     Support  


MySQL PHP to PostgreSQL

How To

If you're running on Microsoft Windows and are confused by this page, I have a help page here: http://www.mikekohn.net/help.php

Step 1: Download and uncompress

To uncompress simply type: tar xvzf mysqlphp2postgres.tar.gz

If you're on a non-GNU system you might have to type: gzip -dc mysqlphp2postgres.tar.gz | tar xvf -

Step 2: Compile

To compile simply type: make

If you're on a non-GNU system you'll have to edit the make file to change the compiler to cc instead of gcc

Step 3: Install

Type: make install

This will simply copy the binary file to /usr/local/bin/

Step 4: Convert

Type: mysqlphp2postgres inputfile.php outputfile.php

The input file is the php page that uses mysql. The outfile is the page you want to create. You will probably need to tell mysqlphp2postgres the name of the postgreSQL database since mysql_select_db doesn't translate. You can do this by using a -d switch. So if, for example, the database you're connecting to is called blah, you could type: mysqlphp2postgres -d blah inputfile.php outputfile.php

Problems:

I have had the following problems from using this program:

  • MySQL has a lot more functions in PHP than PostgreSQL that do more things. I haven't had a problem with any unsupported functions in my programs, but someone probably will. If you want to help write code for this to support those functions (if that's even possible) feel free to help. :)




Copyright 1997-2007 - Michael Kohn

Please visit my many other projects, including free J2ME Java games for Mobile phones, graphics and sound programs, chat software, and much more at http://www.mikekohn.net.

This page was designed to work with all standard HTML compatible webbrowsers including Firefox, IE, Safari, and Links.