|
1 | 1 | --- |
2 | | -layout: docs |
3 | 2 | title: Drupal 7 |
4 | 3 | prev_section: drupal6 |
5 | 4 | link_source: drupal7 |
6 | 5 | next_section: drupal8 |
7 | | -permalink: /docs/drupal7/ |
8 | 6 | --- |
9 | 7 |
|
10 | | -To import your posts from a [Drupal 7](http://drupal.org) installation, run: |
11 | | - |
12 | | -{% highlight bash %} |
13 | | -$ ruby -r rubygems -e 'require "jekyll-import"; |
14 | | - JekyllImport::Importers::Drupal7.run({ |
15 | | - "dbname" => "name", |
16 | | - "user" => "myuser", |
17 | | - "password" => "mypassword", |
18 | | - "host" => "myhost", |
19 | | - "prefix" => "mytableprefix", |
20 | | - "types" => ["blog", "story", "article"] |
21 | | - })' |
22 | | -{% endhighlight %} |
23 | | - |
24 | | -The only required fields are `dbname` and `user`. `password` defaults to `""`, |
25 | | -`host` defaults to `"localhost"`, and `prefix` defaults to `""`. |
26 | | - |
27 | 8 | By default, this will pull in nodes of type `blog`, `story`, and `article`. |
28 | 9 | To specify custom types, you can use the `types` option when you run the |
29 | | -importer: |
30 | | - |
31 | | -{% highlight bash %} |
32 | | -$ ruby -r rubygems -e 'require "jekyll-import"; |
33 | | - JekyllImport::Importers::Drupal7.run({ |
34 | | - "dbname" => "name", |
35 | | - "user" => "myuser", |
36 | | - "password" => "mypassword", |
37 | | - "host" => "myhost", |
38 | | - "prefix" => "mytableprefix", |
39 | | - "types" => ["blog", "post"] |
40 | | - })' |
41 | | -{% endhighlight %} |
42 | | - |
43 | | -That will import nodes of type `blog` and `post` only. |
44 | | - |
45 | | -The default Drupal 7 expects database to be MySQL. If you want to import posts |
46 | | -from Drupal 7 installation with PostgreSQL define `"engine"` as `"postgresql"`: |
47 | | - |
48 | | -{% highlight bash %} |
49 | | -$ ruby -r rubygems -e 'require "jekyll-import"; |
50 | | - JekyllImport::Importers::Drupal7.run({ |
51 | | - "engine" => "postgresql", |
52 | | - "dbname" => "name", |
53 | | - "user" => "myuser", |
54 | | - "password" => "mypassword", |
55 | | - "host" => "myhost", |
56 | | - "prefix" => "mytableprefix", |
57 | | - "types" => ["blog", "story", "article"] |
58 | | - })' |
59 | | -{% endhighlight %} |
| 10 | +importer to select node types. |
0 commit comments