2

I have a client with an old .Net site that used SQL Server. For lots of reasons they decided to switch to Wordpress. They had a bunch of news articles on that old site that they want turned into posts or custom post types on their new Wordpress site (the standard post is probably easier?)

I reached out to their hosting company and got a .bak file of their database and through online research it seems that MySQL workbench is the best route to go as far as getting this file into a MySQL DB. This is where I'm getting stuck. I don't deal with databases a ton besides backing up Wordpress MySQL databases to move them during local to production development or changing url structures.

Do I need to upload this file to a server somewhere like my personal production site's server to make this migration happen?

My plan was copy the Wordpress site over to my localhost and migrate the SQL Server backup file to my local MAMP server somehow as a test to see if it works correctly. I see this question was sort've asked before but there wasn't a ton of dialogue on that so was hoping anyone with new ideas could help me out since I gave a little more context on my goal. I'm on a mac by the way.

There are 1745 articles with categories and subcategories that won't match the current configuration in the Wordpress database. I asked my server side engineer here at work and he said a possible option is to export the database to CSV and use a CSV to Wordpress plugin to import it. Does this sound like a possibly easier solution?

3

Good luck. You'll need to do way more work than just a "restore".

Essentially, you'll need to create a custom pipe to convert the data in the SQL Server database into the table structure used by WordPress.

Even if the table structure was identical, and it isn't, you can't "restore" a .bak file into a MySQL database. The .bak does not contain SQL statements; it is a binary representation, page by page, of the SQL Server database.

Presuming there aren't a huge number of articles, it is generally considered easier to manually transfer them into WordPress using the interface. Welcome to the thrill of vendor lock-in.

If you have access to a SQL Server, you might try restoring the .bak file then exporting the desired data as SQL Statements using the "script database" facility. You might then be able to do a transformation on the SQL Statements to make them "fit" the design of the WordPress database. I'd be very skeptical that this would be easy, however at a certain point this will take less time than manually recreating the stories in WordPress.

| improve this answer | |
0

The .bak file is a Microsoft SQL Server binary backup format. It cannot be used with MySQL - no matter even if you rename it to use another file name extension. A valid .sql file for MySQL is a plain text file with SQL statements supported by MySQL - refer MySQL documentation at http://dev.mysql.com/doc/refman/5.7/en/sql-syntax.html.

To migrate data from SQL Server you will need to connect to it using ODBC. as mentioned here,

| improve this answer | |
  • Yes I understood that first concept. What I am actually wondering is if it is possible to some how take that bak file, open it someway on a mac and export it to CSV and try the plugin route I mentioned – Bs3kg May 13 '16 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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