Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

moving websites from freebsd to linux



2:46 pm on Apr 22, 2008 (gmt 0)

10+ Year Member

I'm taking over a friends website that is hosted on two freebsd servers and need to consolidate the two boxes into one because the hosting fees are higher than the income.

The host said they have tried and tried to move the contents of one box to the other but the website scripts break and would require a programmer to figure it out because all the scripts were written for two servers. There are several hundred custom scripts on each box.

My host (elsewhere) offers much cheaper prices so I'd prefer to move it there but they don't use freebsd.

Are php/mysql scripts on a freebsd server somehow different that what you would use for linux?


2:54 pm on Apr 22, 2008 (gmt 0)

10+ Year Member

Not really different. As long as php is setup the same.

It's probably configuration of the scripts. I'll bet the scripts need to be updated to use the path on the new box, since their location will probably be different. Another thing that might have to be updated, database access and set-up - would need to be replicated and/or the scripts updated.

Wonder: is the database hosted on one server, the site on the other box? That'd be my guess.



3:21 pm on Apr 22, 2008 (gmt 0)

10+ Year Member

Yes, the databases and lots of subdomains are on one box and the main site on the other.

There are literally thousands of scripts on the main server and it's hard to figure out which ones are actually being used. I think it's only a couple hundred of them though.

There is no phpMyAdmin and lots of scripts use mysql commands, also there's a bunch of .sh scripts that I don't even understand.

The host just emailed me and said this,

to combine the two servers we would have to run
everything on a Linux server (as our managed server product runs Linux). We
tried once to move the site as-is to our managed platform and certain
elements of the site would not function.

As a general rule there is usually no problem moving sites freely
between operating systems. However, this particular site is custom designed
and frankly so difficult to follow that we were unable to move the
site and keep it running properly while we tried to troubleshoot it. The
developer of the site would be the best candidate to support any
further attempts to move the site again.

arrrrg. This is turning out to be a nightmare.


3:30 pm on Apr 22, 2008 (gmt 0)

10+ Year Member

.sh scripts are something else entirely - and could be using OS specific utilities and such, making it harder to move. Like the host said, your best bet may be getting with the original developer re: moving. (especially if this is custom php and not based on any common software)


3:49 pm on Apr 24, 2008 (gmt 0)

10+ Year Member

We run our sites on FreeBSD, but no longer use PHP, so my recollection may be a bit hazy. I also investigated moving to linux a while ago, but eventually decided not to.

The Key areas I would investigate are:

1) Location of config files. php.ini on FreeBSD is in /usr/local/etc/php.ini and extensions.ini is in /usr/local/etc/php/extensions.ini

2) Path names in config files (e.g. httpd.conf) - stuff is very likely to be in different places on a linux box (e.g. htdocs may live under /var, while FreeBSD puts it into /usr/local/www).

3) Plain PHP will obviously be the same, but you need to ensure all the required PHP extensions are available. The most incompatible PHP code will be calls to external commands.

4) Any .sh (i.e. bash) scripts may again have hard-coded path names which won't work on linux. FreeBSD's /bin/sh is also different from linux's /bin/bash - bash is mostly a superset, but I have seen /bin/sh scripts fail on /bin/bash.

5) Any external utilities (e.g. tar) called by PHP or the scripts could be in different locations, AND are likely to use some incompatible switches. FreeBSD uses *BSD style switches (obviously); not all of these work or do the same thing as GNU.

6) Read/Write permissions to files and directories used in scripts, etc. (A forked script called from a FreeBSD web server will run as 'www:www', but I believe some linux distros may run it as 'nobody:nobody').

A brute force, quick and dirty approach might be to replicate the locations of everything using symlinks, set file permissions, ensure the PHP configuration is the same, and then you're only left with a bit of .sh script debugging ;)


8:08 pm on Apr 25, 2008 (gmt 0)

10+ Year Member

Thanks for all the info.

Unfortunately we decided to just shut down the site because all the scripts on these two servers are a mess and no one can figure out how it works.

There are literally thousands of scripts, each with a few hundred to a few thousand lines of code and they don't make sense. It's overwhelming to say the very least.

The whole program was given to me for free cause the current owner couldn't figure it out either.


5:11 am on May 2, 2008 (gmt 0)

5+ Year Member

Have you tried to move FreeBSD vps? It might save the cost and you can use same scripts


7:28 pm on May 17, 2008 (gmt 0)

10+ Year Member

Someone with FreeBSD, Linux, shell scripting, server config, PHP, Apache, database, etc... experience like me could likely figure it all out in short order.

The real question for you becomes is the site worth paying someone like me with the relevant experience to deal with figuring it out?

Honestly, it sounds like something that a little knowledge of sed and awk could put right in a few hours of investigation. Posix/gnu utilities are all pretty commonly shared on both platforms and paths aren't all THAT different.


Featured Threads

Hot Threads This Week

Hot Threads This Month