5

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

1
  • Is it running LAMPP or did you install apache, php and mysql separately? Dec 20, 2010 at 10:10

1 Answer 1

6
  • 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

2
  • Thanks! I've always been trying to find where the mysql databases are in the file system.
    – Azendale
    Sep 6, 2011 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, 2011 at 5:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .