Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What is the recommended way of moving an MySQL database from Windows (XP) to Linux (Ubuntu 9.10)?

I am thinking running mysqldump from XP then import on the Linux box - is there a better way?

Has anyone done this before, and if yes, could they please outline the steps required.

[Edit] Should have added this: I am using mySQL v5.1 and I am using InnoDb format

share|improve this question

migrated from stackoverflow.com Dec 21 '09 at 4:26

This question came from our site for professional and enthusiast programmers.

add comment

5 Answers

The mysqldump approach will certainly work, and the result will be reliable. This is the way I would recommend, unless you have very good reasons not to do it like this.

Now, for MyISAM tables you should be able to simply copy the .FRM, .MYI and .MYD files to the appropriate directory corresponding to the target database (MySQL creates a dir corresponding to each database in the data directory)

For InnoDB tables, simply copying the files does not work. I have seen people do it though, for example, see this article: http://www.chriscalender.com/?p=28=1

I Hope this helps.

share|improve this answer
    
+1 for the MyISAM copy method –  o.k.w Dec 20 '09 at 10:05
    
Yep, I have used the mysqldump command to move DBs between NT and *nix environments before, works like a champ. Only ever had one problem before and that was related to line endings in the file, I blame that on my text editor. –  Brent Pabst Jul 2 '12 at 13:24
add comment

You can back up from your Mysql in windows and restore this in Linux . see this :
http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/

share|improve this answer
add comment

You're on the right track. dump and load is the best and most reliable way. Any other method may result in problems, which may not always be immediately evident.

share|improve this answer
add comment

If possible, copying the data files will be the fastest option. Since you won't need to reinsert data or rebuild indexes. Just be sure to take the relevant backups just in case, which may include a mysqldump, before you begin.

You can copy data files from both MyISAM and InnoDB between architectures providing they use the same floating-point format. It's foremost documented here for MyISAM and here for InnoDB. You might also be interested in this thread which asserts specifically that there are no expected format issues when moving between Windows and Ubuntu as a platform. It also includes some useful advice on the procedure.

In relation to Roland's answer, copying or moving InnoDB data is possible and supported. You simply have to be a bit more careful of all the relevant settings. In much the same way that InnoDB will fail to start if you change the data and log size options on whim.

share|improve this answer
add comment

you need to use the 12.04 linux ubuntu and update using update manager.. then install the microsoft windows compatibility wine by simply searching it to ubuntu software update then add the database by adding odbcadd32 in terminal

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.