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!!

  • Is it running LAMPP or did you install apache, php and mysql separately? – LasseValentini Dec 20 '10 at 10:10
  • 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


  • 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

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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