Backups: Difference between revisions

Jump to navigation Jump to search
749 bytes added ,  14 years ago
Line 35: Line 35:
== The database ==
== The database ==
If you use a recent version of Dolibarr, connect with Dolibarr administrator account.
If you use a recent version of Dolibarr, connect with Dolibarr administrator account.
Then go to Home -> System tools -> Backups.
Then go to '''Home -> System tools -> Backups'''.
Choose options for your backup (if possible, keep all default values).
Choose options for your backup (if possible, keep all default values).


If you prefer a manual mode, you can also use your own database admin tools.
If you prefer a manual mode, you can also use the backup tool designed for your database.
With Mysql, the command to backup your database into a file is :
With Mysql, the command to backup your database into a file is :
<source lang="bash">
<source lang="bash">
mysqldump -u user -pyourpass --result-file=dolibarr.version.date.sql databasename
mysqldump -u user -pyourpass --result-file=dolibarr.version.date.sql databasename
</source>
</source>
where ''user'' is MySQL user that Dolibarr use to connect to database, ''yourpass'' is password of MySQL account user (warning, no space between the p and yourpass), ''date'' is the date you can add into output file name (this will help you to find later a backup file if you have a lot of backups), and ''databasename'' is the name of Dolibarr database.
where :
Thoose informations (user, password and database) are available into your configuration file ''dolibarrdir/htdocs/conf/conf.php''
* ''user'' is MySQL user that Dolibarr use to connect to database,
* ''yourpass'' is password of MySQL account user (warning, no space between the p and yourpass),
* ''date'' is the date you can add into output file name (this will help you to find later a backup file if you have a lot of backups),
* ''databasename'' is the name of Dolibarr database.
Those informations (user, password and database) are available into your configuration file ''dolibarrdir/htdocs/conf/conf.php''
 
The result file ("dump file"), is called dolibarr.version.date.sql where
* ''version'' is the dolibarr version (ex: 3.2).
* ''date'' can be replaced with a date, recommanded format is YYYYMMDD, with YYYY the year (ex. 2011), MM is month number (ex. 05) and DD is day in month (ex. 18).
With value used as example, we will get a dump file called ''dolibarr.3.2.20110518.sql.
 
[[File:Warning.png]] Do not trust '''PhpMyAdmin''' (or any other thirdparty tools) to generate your backup dump. PhpMyAdmin is a good tool, but, to generate a backup file, does not include all MySql options/changes. Only using the '''mysqldump''' command can guarantee you generate a dump file you can restore on any Mysql database server/version.


== The documents ==
== The documents ==

Navigation menu