Importieren von anderen Quellen

You have a suggestion for a future version of phpMyFAQ? Then post it here!

Moderator: Thorsten

Post Reply
Nordlicht
Posts: 36
Joined: Fri Mar 04, 2005 5:23 pm

Importieren von anderen Quellen

Post by Nordlicht »

Jetzt habe ich das Forum und die Doku mal nach einer Anleitung zum erfolgreichen Importieren von csv Dateien durchsucht und mußte feststellen, daß es sowas wohl noch nicht gibt. Also hier mein Vorschlag für die Doku:

Code: Select all

"3.a Upgrade - bleibt wie es ist...
3.b Migration

Prerequisites:
1. Application that is capable of exporting csv data
2. Ready configured phpMyAdmin for importing the csv data
3. A recent backup copy of your database

If you would like to migrate your existing data into your phpMyFAQ database we recommend the following steps:
1. Write down your categories to have them available later (or print them with phpMyAdmin); you will find the data in the xx_faqcategories table. If you do not have any categories yet this is a good time for creating them, you´ll need them in less tha a minute...
2. Open your application used for calculations (e.g. OpenOffice, Excel, etc.)
3. Create a new sheet containing the following data:

id	lang	active	rubrik	keywords	thema	content	author	email	comment	datum

In case you do not have any data already in the phpMyFAQ database your "id" field counts from 1 otherwise look at your current xx_faqdata to find out the highest "id" number to start counting from. The field "lang" contains the language you prefer. In my case you´ll find "de" becuase my preferred language is German. Set "active" to "yes" (without qoutation marks of course) otherwise the data won´t display later. "rubrik" stands for the categories that you created earlier. You can leave out "keywords" for now but remember that you´ll need them in case you want to find your FAQs by keywords. "thema" describes the FAQ topic or in other words the question. "content" contains the answer to the frequently asked question. "author" and "email" shold be seld-explanatory. "comment" is just a value and can be "y" or "n". I´d prefer "n" to disable users from commenting but this is up to you. You should be careful with "datum" as this value strongly depends on the format. An example would look like this: 20050401090000 in other words: 4digits year (2005), 2 digits month (04), 2 digits day (01), 2 digits hour (09), 2 digits minutes (00) and 2 digits seconds (00). Your table could look like this now:

id	lang	active	rubrik	keywords	thema						content	author		email			comment	datum
1	de	yes	FAQ	phpMyFAQ	Is there any better solution than phpMyFAQ?	No!	Nordlicht	nordlicht at home de	n	20050401090101

Be aware that the fields containing numbers should default to "number" with 0 decimals otherwise phpMyAdmin could do wrong. Now you are ready to export to csv. Do yourself a favour and avoid any spaces in the filename, UNIXes could have trouble to read the filename otherwise.

4. Open your phpMyAdmin URL and open your phpMyFAQ database (even if it was still empty). Scroll down the page click on the link "import text file" ("Textdatei in Tabelle einfügen"), choose your file and click "submit" button. 
That´s it. Should you have any trouble it is a good time to restore your data from the backup you saved earlier."
Ist aber nur als Vorschlag zu verstehen. Vielleicht gibt es elegantere Wege - aber so hat´s bei mir OHNE Probleme funktioniert.

Grüsse,
Nordlicht
Thorsten
Posts: 15729
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

danke für den Text, kann ich den so der Doku hinzufügen?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Nordlicht
Posts: 36
Joined: Fri Mar 04, 2005 5:23 pm

Post by Nordlicht »

Hi Thorsten

Ja, gerne. Dafür war das auch gedacht ;-) Hoffe, daß das in dieser Form auch von anderen Usern nachvollzogen werden kann.

Wenn Du möchtest, kannst Du mich irgendwo in den Credits vermerken. Real Name: Markus Gläser

Grüsse,
Nordlicht
Thorsten
Posts: 15729
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

ist seit eben im CVS, inkl. Credits.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply