Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an old Ubuntu LAMP server. I'd like to move the webpage over to a newer Ubuntu server and I'm wondering what the easiest way to backup and restore the webpage would be? Or just the easiest way to transfer the settings to a new server.

The first idea that came to my mind was just to set up a new LAMP server and then recreate the database, import the data,... but there must be a better way, right? :)

Thanks for your help!!

share|improve this question
    
Is it running LAMPP or did you install apache, php and mysql separately? –  LasseValentini Dec 20 '10 at 10:10

1 Answer 1

up vote 5 down vote accepted
  • Your new server might not have the same hardware.
  • So install LAMPP server on the new system.
  • Shutdown the mysql service.

    sudo /etc/init.d/mysql stop

  • Then copy /var/lib/mysql from the old system over to the new system.
  • Then copy /var/www from the old system to the new system.
  • Start up mysql again.

    sudo /etc/init.d/mysql start

Note:

  • Most of the time copying /var/lib/mysql from one system to another system will work.
  • In anycase if that din work for you,then do mysqldump on the old server and run the resulting sql on the new server with mysqlimport.

    mysqldump --all-databases > db_name.sql
    mysqlimport db_name.sql

share|improve this answer
    
Thanks for your help! –  Evan Dec 20 '10 at 17:51
    
Thanks! I've always been trying to find where the mysql databases are in the file system. –  Azendale Sep 6 '11 at 17:05
    
Also, you might want to make sure the ownership is set right--it seemed to make my mysql not start when it was wrong. (Then I had to purge/reinstall all the mysql stuff after that). –  Azendale Oct 11 '11 at 5:03

Your Answer

 
discard

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

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