Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I install Magento with a MS SQL Server 2008 database? 
 
fernaramburu
Jr. Member
 
Total Posts:  3
Joined:  2012-02-29
 

Hi,

My company has 100% MS SQL Server databases and we need to install a Magento and run it against a MS SQL Server 2008.

Can I do it or Magento only runs with MySQL?

Thanks

Fernando

 
Magento Community Magento Community
Magento Community
Magento Community
 
NuBlue
Sr. Member
 
Avatar
Total Posts:  94
Joined:  2008-03-31
Lancaster, United Kingdom
 

Hi fernaramburu

The short answer is no. However you could install mysql and php on the server in order to get magento running on windows 2008 server, something like XAMP etc (there maybe a better performing version of mysql/php for windows out there), if its then communication with an MSSQL database you need you would need to build some kind of \"middle man\” parser to translate the communication between the two systems.

Let me know if you do decide to take on a project like this, it would be interesting to see the outcome!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Grow
Jr. Member
 
Total Posts:  21
Joined:  2009-12-04
 

I’ve been doing some research into putting Magento on MSSQL and I don’t think it would be that hard. There was a major change in Magento v1.6 to use the PDO_mysql driver, because of this it should be possible to use the pdo_dblib (which on linux connects to mssql). I was able to get magento to connect to the MSSQL server, but because Magento was still trying to pass Mysql syntax I was not able to create the database…

Here is what I have done

1. I duplicated the Mysql.php files in the following locations and renamed them Mssql.php

app/code/core/mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php
lib/Varien/Db/Adapter/Pdo/Mysql.php
lib/Varien/Db/Statement/Pdo/Mysql.php

2. I modified the new Mssql files to use MSSQL

app/code/core/mage/Core/Model/Resource/Type/Db/Pdo/Mssql.php
This is the file that connects Magento to the Varien library that contains the Sql code
- I just changed everywhere it said Mysql to Mssql

lib/Varien/Db/Statement/Pdo/Mssql.php
I think that this file is what executes statements
- again I just changed the Mysql to Mssql

ib/Varien/Db/Adapter/Pdo/Mssql.php
I think that this file builds the statements this one requires a little reworking
- again I just went through it changed the Mysql to Mssql, but then I had a co-worker who know Mssql alter the Mysql only syntax to be Mssql Friendly

3. I Modify app/etc/local.xml and app/etc/config.xml so it would use the new connection scripts

app/etc/local.xml

Connection example
<connection>
<host><![CDATA[192.168.5.5:1165]]></host>
<username><![CDATA[sa]]></username>
<password><![CDATA[Devteam,1]]></password>
<dbname><![CDATA[magento]]></dbname>
<initStatements><![CDATA[]]></initStatements>
<model><![CDATA[mssql]]></model>
<type><![CDATA[pdo_mssql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>

app/etc/config.xml

add connection type
<pdo_mssql>
<adapter>Varien_Db_Adapter_Pdo_Mssql</adapter>
<class>Mage_Core_Model_Resource_Type_Db_Pdo_Mssql</class>
<compatibleMode>1</compatibleMode>
</pdo_mssql>

4.This is where I ran into a problem, the database setup scripts are all written for Mysql and there is about 40 files that all start with mysql4. Someone would have to go through each one and Modify all the queries if the database is to install on MSSQL
They are located in the below folder
app/code/core/Mage/Core/sql/core_setup/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rakesh Alhan
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2011-01-31
 

Hello Ryan Grow,
Firstly a big thanks for your this post.

But can you please confirm, is this working on your end?

Even i have tried this. I made copies for following files
\lib\Varien\Db\Adapter\Pdo\Mysql.php
\lib\Varien\Db\Statement\Pdo\Mysql.php
\app\code\core\Mage\Core\Model\Resource\Type\Db\Pdo\Mysql.php
\lib\Zend\Db\Adapter\Pdo\Mysql.php
\lib\Zend\Amf\Parse\Resource\MysqlResult.php

But..
Please help, what’s wrong i’m doing..

Thanks,
Rakesh Alhan

 
Magento Community Magento Community
Magento Community
Magento Community
 
DesignGeek
Jr. Member
 
Total Posts:  1
Joined:  2011-06-28
 

I am interested in paying for the development of SQL Server as a backend for magento.

Is anyone working on SQL Server adapter and creation files?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top