Sunday, January 27, 2008

Server Transportation

Yesterday, I transfered CE shell server to a new and great one. The new one specs is as follows:
HP ProLiant DL380 G5 with Dual Quad Core Xeon 2.3Ghz and 4GB RAM!
And the old one:
Gigabyte 6VXD7 with Dual Core Pentium III 1Ghz and 1GB RAM. In fact this was a desktop computer.

I hope this extreme change will increase the uptime of the server a lot. Another advantage is server load decreases significantly as I expected.

The hardest part of migration was copying MySQL. First I tried to dump it and import it with this command:
Dump: mysqldump -u root -p --all-databases>back.sql
---> I transfered "back.sql" to new server and then:
Import: mysql -u root -p <back.sql
It worked but the problem was the permissions doesn't remain as was! All databases became belonged to root and no one can access to his/her database. After lots of investigation, I remembered the golden sentence in *nix world:
Everything in *nix are FILES.
First I stopped the mysql server on both computers, and then I copied /var/lib/mysql with rsync from old server to new one. Then I started the mysql daemon and wow! Everything works perfectly as I want.

No comments: