Restore of your MySQL database
Prev | Chapter 17. Backing up your more.groupware data | Next

## Restore of your MySQL database

A backup only makes sense if you can actually restore it. So you should try this at least once before a desaster, to make sure it all works as expected!

| Note
Agraphical web based tool to help you with the tasks described in this section is phpMyAdmin which can be downloaded from http://www.phpmyadmin.net/

1. Configure your computer with the same Apache and MySQL settings as before the 'computer crash'.

2. Copy your mgw folder backup back to the same place your old installation was placed in.

3. Run this to create an empty database:

   mysql -u username -p -e 'CREATE DATABASE database'

   Use the same `database` name as the old database had. Replace `username` with the name of a user that can create a database.

4. Restore the data with the command:

   mysql -u username -p database < path/to/backup.sql

   You must replace `username` with the name of a user that can create tables in the `database` you use just created. `path/to/backup.sql` is the path and name to the file that was written during backup, e. g. `C:\backup\mgwbackup.sql`. After entering the command you have to press enter. Insert the MySQL password and press enter yet another time. The database will be restored with all the information from the backup file.

Hopefully you can log into Moregroupware now without any data loss!

Prev | Up | Next
Chapter 17. Backing up your more.groupware data | Home | Part IV. Área do Desenvolvedor