还原: Difference between revisions

Jump to navigation Jump to search
Line 37: Line 37:
  * Reprendre le fichier archive (fichier zip par exemple) du répertoire documents et en extraire l'arborescence dans le répertoire documents d'une nouvelle  
  * Reprendre le fichier archive (fichier zip par exemple) du répertoire documents et en extraire l'arborescence dans le répertoire documents d'une nouvelle  
   installation de dolibarr ou dans le répertoire documents de cette installation ('''''chemin du répertoire des documents''''').
   installation de dolibarr ou dans le répertoire documents de cette installation ('''''chemin du répertoire des documents''''').
此目录必须为空(否则,可以清除其内容)。 您所要做的就是将备份目录的内容从旧文件复制到该目录中。
此目录必须为空(否则,可以清除其内容)。 您所要做的就是将备份的目录内容复制到该目录中。
=Step 3 - Restore the database=
=步骤 3 - 还原数据库=
==MySql==
==MySql==
Copy the backup dump file into the same directory than the command '''mysql'''.
在非Linux平台上,如果DOS无法识别'''mysql'''命令,这意味着PATH变量未指向 mysql.exe 所在的目录。 它必须:


If your backup file was a compressed archive, unzipping the file before might be required:
* 在系统变量PATH中添加mysql.exe文件所在的目录;
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'''.
* 将备份转储文件复制到mysql.exe文件所在的目录;


Choose the import method.
如果备份文件是压缩文件,请先解压缩该文件。
 
例如,一个名为 mysqldump_dolibarr_2.7.0_200812021800.sql.bz2 的已压缩备份文件必需被解压缩为文件                      mysqldump_dolibarr_2.7.0_200812021800.sql(Linux平台启动命令bunzip myfile.bz2,Windows平台启动命令 7zip)。
 
在新安装的Dolibarr上,使用管理员帐户登录,然后前往菜单 '''主页 / 管理工具 / 还原''' 。
 
选择导入MySQL的方法。
 
然后,Dolibarr在命令行中显示一个命令,该命令带有隐藏密码,以执行数据库还原。单击“显示完整命令”以获得未隐藏密码的完整命令。
 
例如,我们将有:


Dolibarr offers a command line to launch to restore the database. Click on "Show the full command".
For example, you will have :
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
mysql mydatabase -h localhost -u databaseuser -pdatabasepass < mybackupfile.sql
mysql mydatabase -h localhost -u databaseuser -pdatabasepass < mybackupfile.sql
</syntaxhighlight>
</syntaxhighlight>


Open a command line shell (DOS Command line with Windows or a Shell terminal with Linux).
打开命令行shell(Windows平台的DOS命令、Linux平台的shell终端...)。
Go into the directory where command '''mysql''' and your backup file is stored.
 
Launch the command provided previously.
前往保存着要还原的备份文件和命令'''mysql'''.exe的目录。 运行先前提供的命令,知道每个空格(或缺少空格)、"—"或"<"是必需的,否则将产生语法错误。




714

edits

Navigation menu