Restaurations

From Dolibarr ERP CRM Wiki
Revision as of 20:20, 29 November 2009 by Eldy (talk | contribs)
Jump to navigation Jump to search

Cette page décrit comment restaurer une sauvegarde de Dolibarr (par exemple après avoir formatté votre disque dur). Pour savoir comment faire une sauvegarde complète, voir la page Sauvegardes.

Pour une restauration complète, on suppose que :

  • Vous avez une sauvegarde de votre base de donnée (dans un fichier dump).
  • Vous avez une sauvegarde de vos fichiers du répertoire documents.
  • Vous connaissez le login et mot de passe d'un utilisateur administrateur que vous utilisiez pour le Dolibarr qui a été sauvegardé.

Reinstaller le logiciel Dolibarr

If you have uninstall Dolibarr or not yet installed because you are on a new server, you must install Dolibarr as if you want to use it with a new clean database. Be carefull to choose the same database type than before (Mysql, PostgreSQL...).

You can install any Dolibarr distribution of your choice (Dolibarr, DoliWamp, DoliMamp, any other Linux distribution...), however it must be exactly the same version (vX.Y) than the one used to make the backup (if backup was done using Dolibarr 2.7 or more, the version might be included in the file name of the database backup).

Restore documents

On your new installed Dolibarr, go with an administrator user in the menu Home / System Tools / Restore.

Dolibarr will show you where your documents files must be stored. This directory must be empty (if not you can purge it). All you have to do then is to copy content of your saved directory of old documents files into this directory.

Restore the database

Copy the backup dump file into the same directory than the command mysql.

If your backup file was a compressed archive, unzipping the file before might be required: For example, a bzip archive backup named mysqldump_dolibarr_2.7.0_200812021800.sql.bz2 must be uncompressed to mysqldump_dolibarr_2.7.0_200812021800.sql (Launch bunzip myfile.bz2 under Linux, or use 7zip under Windows).

On your new installed Dolibarr, go with an administrator user in the menu Home / System Tools / Restore.

Choose the import method.

Dolibarr offers a command line to launch to restore the database. Click on "Show the full command". For example, you will have :

mysql mydatabase -h localhost -u databaseuser -pdatabasepass < mybackupfile.sql

Open a command line shell (DOS Command line with Windows). Go into the directory where command mysql and your backup file is stored. Launch the command provided previously.

Use your restored Dolibarr

After command is finished, you can go on Dolibarr logon. Now you must use a login account that was existing when the backup was done.