Categories
|
|
|
Export articles to XML, HTML, CSV, or SQL
Author: Edward Hardin Reference Number: AA-00540 Views: 17066 Last Updated: 08/13/2014 09:51 AM |
0 Rating/ Voters
|
|
There is a quite simple way to export articles from the knowledge base that doesn't require programming knowledge (in contrast with exporting via API, where you need at least basic knowledge of PHP, or other language).
If you're using a hosted solution and want to export your articles, please contact us.
This method allows you to export all knowledge base articles to XML, HTML, CSV, or SQL format.
- Download HeidiSQL tool and install it. You need the latest stable package installer. HeidiSQL runs fine on Windows (2000, XP, Vista, 7) and on any Linux with Wine.
- Run HeidiSQL and enter connection data for the MySQL server (the one that stores KMP data).
If you do not remember connection details, you can find them in the /admin/config.inc.php file under the KMP folder. Scroll to the 50 line of this file (line number may very depending from the KMP version, but you would be able to find the line below anyway), and you will see something like this:
'tablePrefix' => '' ); } function __getDBConfig() { return array( 'hostname' => 'yourwebsite.com', 'username' => 'kmp-user', 'password' => '*****************', 'database' => 'kmp',
Values of "hostname", "username", "password", and "database" parameters can be used to connect to the MySQL database.
If the "hostname" is "localhost" and you're connecting from a remote host (for example from your PC, while KMP is installed on a remote server), you would need to use the server domain address or IP. If "hostname" may have an internal IP address (e.g. 127.*.*.* or 192.*.*.*) and if you're connecting from another network (which is external to the network with the KMP server), you would need to use the external IP of this server.
The MySQL server may have connection restrictions, so it is possible that you want be able to connect to it from you PC. Contact your server administrator to resolve this. If you experience troubles with connection, it would be better to install HeidiSQL on the same server where KMP or MySQL server runs - in this case you will be surely able to connect. Though security restrictions in you company may not allow this. - Once connected to the MySQL server, select the KMP database on the left, and then click on the Query tab on the right.
- Insert the following query to the area below the query tab (this exports article code, title, and body).
or use this one to export categories as well:
You may need to make changes to the query before running it. For example, if you are using a table prefix, you would need to add it before `faq_articles`, e.g. : `prefix_faq_articles`. Surely, you need to use the actual prefix instead of the "prefix_". You can find the actual prefix in the /admin/config.inc.php file. It is set by the "tablePrefix" parameter (it is set a little bit higher than MySQL server connection details).
You can see that these queries select only four rows of data: `code`, `question`, `answer`, `cat_name`. You may want to select more rows, for example article creation date, its rating, etc. In this case you would need to add these rows to the query. Also you can modify the WHERE part of the query to select articles by certain parameter, for example export only published articles, or articles with rating more than certain value. Refer to the MySQL SELECT syntax for more details. - Press F9 to run the query. If there are lots of articles and you're connecting to a remote database, it may take several minutes to complete the query.
- Now you can select the rows you want to export. To select all rows, press Ctrl-A. Then right-click and select "Export grid rows...".
- On the last step you can select a desired file name, location and format.
|
|
|
|