How to migrate XAMPP from Windows to Linux? [SOLVED]

Problems with the Linux version of XAMPP, questions, comments, and anything related.

How to migrate XAMPP from Windows to Linux? [SOLVED]

Postby Coen Naninck » 06. December 2011 20:01

Hello,

I've looked through Google for ages but I either I am not looking right, or no one has ever asked this question before:

"How does one migrate a WIndows installation of XAMPP to Linux?"

Here's my situation in detail:

I used to have a Windows install of XAMPP on the 2nd partition of a hard drive. Partition 1 was my C:\ drive, containing my Program Files and Windows, while partition 2 was my D:\ drive, containing XAMPP (in the root), among other files.
I've switched to Ubuntu 11.04 64-bit now. I've Googled a bit where to move the directories to, but there are conflicting posts, one telling to put them here, another one to put them somewhere else. I've tried both and in each case get a 403 error. I've stopped the server when copying files and put all permissions to my own usergroup.

I would really like to know how to do this. I also wonder why there isn't a step-by-step tutorial for this available, or if there is where it can be found.

Thank you in advance for your time.
Coen Naninck
 

Re: How to migrate XAMPP from Windows to Linux?

Postby JonB » 06. December 2011 20:51

put all permissions to my own usergroup.


That is not going to work - period.

I suggest you browse this forum for my posts on 'how lampp works' - it is NOT a standard 'LAMP' Stack -
pretty much the owner of files in htdocs has to be 'nobody:root'.

I also wonder why there isn't a step-by-step tutorial for this available, or if there is where it can be found.


I guess after this week I will have said enough on this to make an article out of it. Linux may have been 'desktop-ized', but you can't make a server work even with XAMPP without a fair knowledge of how Linux works and how to use the 'command line'/console/term. LAMPP is a much tougher go than XAMPP for Windows. Most folks go in the 'other direction', and that is probably why there aren't any step by step guides - Now maybe there is.

"to me" - Its quite simple actually

A. Make sure the PHP and MySQL versions are 'close enough' - ideally you should be on the same 'version' of XAMPP

B. Backup all your databases on your old machine (back them up to either tar, tar.gz or .sql files) Be sure to include the 'Create Database' options

C. Copy out your htdocs folders (minus the xampp folder) on your old machine to a thumb drive

D. Install XAMPP/LAMPP on your new Linux Box

E. Make sure everything works. including phpmyadmin, and the XAMPP 'demos'

F. - Recreate the MySQL Users and Passwords that YOU added.

G. - Restore only your 'user created' databases from your backups.

H. - Copy the files from your thumb drive into /opt/lampp/htdocs on your Linux box.

I. - Change the permissions and ownership of the files in htdocs as needed, using term.
First - tackle ownership
Code: Select all
[jonb@localhost]$ su
password
[root@localhost jonb]# chown -R nobody:root /opt/lampp/htdocs

Check results carefully using 'ls'
Check permissions AND ownership of files and folders.
Generally folders should be 755, and files 644

J. Compare your php.ini configurations before you try to run anything, make sure they are as close as possible.

K. Make any needed changes to your Apache configuration files - "vhosts, XAMPP protection etc". Clearly you will need the absolute linux paths, and need to make any permission changes.

that should do it.
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to migrate XAMPP from Windows to Linux?

Postby Coen Naninck » 07. December 2011 00:08

Thanks, I will have a look at this. It doesn't seem too difficult.

The su command for term never works for me by the way, I always get "su: Authentication failure" after I enter my pw. But doing sudo works. But that's just a side thing.

I'm thinking maybe I should just create a new database and then use a laptop with Windows still installed on it to copy the settings via the WordPress (that's what I'm using on it) Admin over to my Linux system. I haven't really gotten a whole lot of text in it anyways, and the site theme I can just copy over anyway. It would be a different matter if I had a lot settings, but with this specific site it's not a lot of work. Maybe doing a pristine install on Ubuntu is better anyway, than using databases that were created in Windows. It's not the first time I've run into compatibility issues in a program because the files were created on another operating system. This way I can avoid the file permission setting thing too.

I will think about the best way to do this. In any case thank you very much for your time and hopefully others will benefit from this post too, once Google indexes it.
Coen Naninck
 

Re: How to migrate XAMPP from Windows to Linux?

Postby JonB » 07. December 2011 06:26

I always get "su: Authentication failure" after I enter my pw


that is likely because you need to use the "root" user's PW, not "yours" for 'su' - "yours" works on 'sudo'. :shock:

I have a bunch of WP sites on 3 different OS's and 3 different webservers - have had ZERO problems moving the databases across platforms. The one thing to be SURE to move/backup separately are your Media libraries, the database backup does not include them. The Excruciatingly Correct Guide in my sig is my XAMPP powered WP CMS, take a look. If I told you what it runs on, you might not believe me (and its not the only thing on that machine). In fact I am typing your reply on it and having a beer... 8)

You should read the tips on the WordPress Codex (which MIGHT be the best support site/documentation on the planet) about server moves.

Things like blogs. forums and CMS's usually have to have their db users created, then installed fresh, then restored back.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How to migrate XAMPP from Windows to Linux? [Answered]

Postby Coen Naninck » 10. December 2011 22:30

Thanks Jon.
Coen Naninck
 

Re: How to migrate XAMPP from Windows to Linux? [SOLVED]

Postby JonB » 11. December 2011 21:07

Glad it worked out - Good Luck

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 25 guests