2

Last night, I backed up my Ubuntu 10.10 box using the sbackup utility. The process ran with the default options, which backed up the /etc /home /usr /var directories to a separate partition on my machine.

After the backup completed successfully, I installed Ubuntu 11.04 over the existing Ubuntu 10.10 partition and installed the lamp-server meta package using tasksel:

$ sudo apt-get install tasksel
$ sudo tasksel install lamp-server

When prompted, I entered the same MySQL root password as used on Ubuntu 10.10.

What's the easiest way to restore the user accounts, databases and configuration from /media/backup/var/lib/mysql to the new installation?

Thank you.

1
  • Just for future reference, the do-release-upgrade tool is generally a nicer way of getting to a new release. Apr 29, 2011 at 21:30

1 Answer 1

1

If MySQL was shutdown while you were doing the backup, you should be able to simply put the files back in place. In standard distributions, mysql data is located at /var/lib/mysql (you can check in the /etc/my.cnf for the actual path if it's different). So, I would:

  • shutdown mysql-server if it's running
  • move the current /var/lib/mysql folder to a safe place (even though it pretty much empty)
  • copy your backup from /media/backup/var/lib/mysql to /var/lib/mysql
  • restart mysql-server

done-ski!

2
  • MySQL was running when the backup was performed. What implications does that have?
    – unpossible
    Apr 30, 2011 at 8:35
  • 1
    If you're using Innodb tables you can't be certain that all the data has actually been written to disk at any single point in time, as it caches in memory. That said, in practice is depends on how busy your server/site is, but in general, you don't want to do external file operations on your database servers data while it's running or you may end up with inconsistent results. May 1, 2011 at 2:38

You must log in to answer this question.

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