Import
From Textbook
Textpattern's import features allow you to import Weblog articles from another Weblog system.
Contents |
Panel Controls
The import panel is pretty simple, consisting of just four controls (Figure 2), which are described in the following sections.
Import from (1)
The first control is a dropdown box that lists the various systems Textpattern supports at any given time (Figure 3).
For each system supported, there is generally one of two ways the publishing system data is imported, either via a text file or via a MySQL database, and sometimes, as in the case of Movable Type, both methods are supported as indicated in Figure 3. If a system does not indicate which mode is supported in the dropdown options, it could be one or the other, but not both.
For clarity, the supported modes for the existing system options are as follows:
- Movable Type (file or database)
- Blogger (file or database)
- b2 (database)
- Wordpress (database)
Section to import into (2)
The second control is a dropdown box that simply lists all the Sections that you currently have created in Textpattern (Figure 4).
Default article status (3)
The Default article status control is a dropdown box that lists Textpattern's article status options (Figure 5). These are the same options you choose from when first drafting an article in the Write tab.
Default comments invite (4)
The Default comments invite control is a text box that allows you to create a custom label for the comments invite link that will appear for your respective articles (Figure 6).
The Process
Importing from a Text File
Importing systems via a text file (such as for Movable Type and Blogger) can be done by first exporting data into a text file, which in turn can be imported into Textpattern. Do this as follows:
- Name the textfile
import.txtand place the file in the directory located at/textpattern/include/import/. - Go to the Import subtab (the panel you are reading about now), and make the appropriate selections as described under the Controls section above (Figures 3 through 6).
- Click the Continue button. Textpattern will use your text file
import.txtand import it's contents into the Textpattern database structure. You get a list of imported articles with a message at the end about the status of the action.
When it's done, you can go the the Articles tab and see all your articles are now listed, which should be the case if all went reasonably well.
See also the articles:
Importing from a MySQL database
When you select a system from the dropdown Import from options (Figure 3) that is a database option, a new set of controls will appear under the regular tab controls. The controls will consist of a common set of configuration fields for all imported systems (Figure 7).
However, depending on which system you are importing, there may be an additional field specific to that system, which is talked about shortly in the following sections.
In any case, you begin for all systems by filling in the common database information indicated in Figure 7. Movable Type and WordPress each has an additional, unique field to address in the Database Data controls.
For Movable Type it will be a control called Weblog ID (Figure 8).
For Wordpress it will be a control for table prefix (Figure 9). Most likely you can leave the default wp_ if you haven't changed that when you installed WordPress (you might have changed it if your WordPress site shared the database with another application).
Fill in the information accordingly and press the Continue button.
Textpattern will connect to your old database and import the external system's contents into the Textpattern database structure. You get a list of imported articles with a message at the end about the status of the action.
When it's done, you can go the the articles tab and see if all went well. If so, congratualations and welcome to Textpattern.












