0

I've been put in charge of migrating a customer's website of MS SQL/ASP to PHP/MYSQL. I have zero experience with MS SQL.

I'm trying to figure out the best way to get the current data migrated to MySQL so I can begin PHP development.

Some details:

  • I downloaded SQL Server Mangement Studio Express. I found the following string in a connection file:

    MM_connCompanyName_STRING = "provider=SQLOLEDB;data source=IP_ADDRESS;database=DATABASENAME;uid=USERNAMEpwd=PASSWORD;"

  • Using the IP, username, and password from this string, I could successfully connect using Studio Express.

  • I downloaded the MySQL Migration Toolkit and entered the same info, but get the following error:

    Connecting to source database and retrieve schemata names. Initializing JDBC driver ... Driver class MS SQL JDBC Driver Opening connection ... Connection jdbc:jtds:sqlserver://IP_ADDRESS:1433/DATABASENAME;user=USERNAME;password=PASSWORD;";charset=utf-8;domain= The list of schema names could not be retrieved (error: 0). ReverseEngineeringMssql.getSchemata :Login failed for user 'USERNAME'.

  • I don't have admin or physical access to the current SQL server. I've tried to run some exports through Studio Express, but it saves them to the file system, which I don't have access to.

  • I can reach the current/old webmaster, but because he no longer works for the company, his responses are slow and usually un-helpful. So no help there...

  • The former admin sent me an MDF file ... no idea what to do with that.
  • I found this note above the connection info on the current server (if it means anything):

'this connection is being used because ODBC was causing weird errors, switching to OLEDB fixed them

My questions:

  1. Any idea why this would be failing with the same login credentials that works with Studio Express? I'm assuming it has something to do with the driver, but I don't know what next steps to take.
  2. Is there a better/easier/more effective way to migrate this data? (I'm hoping I don't find myself running "SELECT *" statements in Studio Express and copy/pasting data into Excel...please god, no)

Thanks in advance for your help.

4

2 回答 2

1

Eww,这将是可怕的(连接字符串表明它是从 Dreamweaver 生成的工具,绝不是一个好兆头)。

知道哪个版本的 SQL Server 吗?您应该能够选择@@VERSION。10.x 是 2008,9.x 是 2005,8.x 是 2000。如果是 7.x 运行。

MDF 文件是实际的数据库。如果我是你,我会购买 SQL 2005 的开发人员版(如果不太可能是 2008 年则购买 8 个),这将值 99 美元左右的成本。

这将使您能够通过附加 MDF 文件在本地安装数据库。一旦你有一个本地运行的副本,你可以使用带有 MySql ODBC 驱动程序的 SQL Server ETL 工具以可重复的方式将数据推送到 MySql。

于 2009-06-17T00:35:54.673 回答
0

我相信您可以选择不同的 SQL 方言从 MSSQL 导出数据;我相信有一个与 MySQL 相当兼容的。当然,它并不能解决你所有的问题,因为虽然你可以正确地获得结构,但存储过程和触发器等将需要更多的工作。但这应该让你开始。

于 2009-06-13T22:34:37.520 回答