My D6 site is running on linux and I'm using Postgresql as database. but now I want to change mssql as database on windows. how I do that?

2 Answers 2


Once your new server is running, you only have to do a few things.

  1. Dump the old database (PgSQL)
  2. Convert the dump to MSSQL
  3. Import the dump.

If you search on google you should be able to find tools that will allow you to export convert the dump. This is not perfect but is probably the easiest solution.

Alternatively if that doesn't work, you can create a script that from within Drupal fetches data from one database and then inserts it into the other database, effectively using Drupal/PHP to translate the dump. This is much slower and requires more work, but have less chance of failure.

  • Thanks. but how I connect to database server and it's MS Sql.
    – Abhijeet K
    Jan 30, 2012 at 9:25
  • 1
    @Abhijeet just noticed your version number, MSSQL is not supported for Drupal 6 core, so you would need to modify core to allow it to use MSSQL. (only PgSQL and MySQL is supported for Drupal 6). Drupal 7 will allow you to use MSSQL though.
    – googletorp
    Jan 30, 2012 at 9:38
  • hmmm.. ok. Someone told me to use freeTDS on linux but I cant get it.
    – Abhijeet K
    Jan 30, 2012 at 10:00
  • @Abhijeet Maybe they were talking about FreeBSD, it's open source.
    – googletorp
    Jan 30, 2012 at 10:03
  • check freetds.org
    – Abhijeet K
    Jan 30, 2012 at 10:12

This is simply not possible with Drupal 6, nor will it ever be. It is possible with Drupal 7 on IIS only.

Drupal 7 has a database abstraction layer, so it can be used with any database that has 1) a system database driver and 2) a module to do the un-abstracting to the specific database you want to use. Check out the Drupal SQLSRV project for 2.

The title says this is for a site running on Redhat Linux, but the question says Windows. This only works if you are using IIS as your webserver.

System drivers for MSSQL are barely available for RHEL 5, just released by Microsoft as a PDO driver in December (though this guy got it compiled for a Fedora release, so YYMV), and the Drupal module doesn't support the RHEL system drivers at this time.

  • Thanks Renee for your support. the driver you mentioned is for 64 bit I am using 32bit Linux. but now we change our requirement and using SQL server only for some pages, I have done it by installing FreeTDS on linux now I am able to fetch data from SQL server. It's great.
    – Abhijeet K
    Feb 8, 2012 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.