PHPackages                             vanilla/knowledge-porter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. vanilla/knowledge-porter

ActiveProject[CLI &amp; Console](/categories/cli)

vanilla/knowledge-porter
========================

A command line porter for Vanilla Knowledge

v2.2(1y ago)021.5k↓37%PHPPHP ^8.1

Since Mar 16Pushed 1y ago3 watchersCompare

[ Source](https://github.com/vanilla/knowledge-porter)[ Packagist](https://packagist.org/packages/vanilla/knowledge-porter)[ RSS](/packages/vanilla-knowledge-porter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (63)Used By (0)

knowledge-porter
================

[](#knowledge-porter)

A command line porter for Vanilla Knowledge.

Example:

```
./bin/knowledge-porter import --config="./customer1.zendesk.json"

```

Where `./customer1.zendesk.json` is relative path to your configuration file.

Configuration file contains set of feature flags for porter to configure source and destination (data &amp; api). Example:

```
{
    "source": {
        "type": "zendesk",
        "protocol": "http", // For local setup only
        "prefix": "{PREFIX}", // prefix to set foreign id on destination records
        "domain": "{ZENDESK_API_DOMAIN}", // eg: help.gink.com
        "token": "{EMAIL_TOKEN}", // eg: dev@mail.com/token:xxQWERTYptodnoL
        "targetDomain": "{NEW_DOMAIN_PATH}", // eg: dev.vanilla.localhost
        "perPage": 2,
        "pageFrom": 1,
        "pageTo": 100,
        "sourceLocale": {Zendesk locale} // eg: "en-us"
        "destinationLocale": {locale} // eg: "en-us"
        "import": {
            "categories": true,
            "retrySections": true,
            "sections": true,
            "authors": true,
            "articles": true,
            "translations": true,
            "attachments": true,
            "helpful": true,
            "fetchPrivateArticles": false,
            "fetchDraft": false
        },
        "api": {
            "cache": true,
            "log": true
        }
    },
    "destination": {
        "type": "vanilla",
        "domain": "{VANILLA_API_DESTINATION_DOMAIN}", // ex: dev.vanilla.localhost
        "token": "va.{VANILLA_API_TOKEN}",
        "update": "onChange",
         "api": {
            "cache": false,
            "log": true,
            "verbose": false // Display more informations for each request
        }
        // by default we don't want KB to be patched after 1st sync
        // that will allow to avoid kb-url-slug update if edited on vanilla side
        "patchKnowledgeBase": false,
        "syncUserByEmailOnly": false
    }
}

```

Alternatively, you can set the porter configuration into an environmental variable and tell the porter to use the variable instead of the configuration file.

Example, assuming your configuration is set on the variable CONFIG:

```
./bin/knowledge-porter import --config="ENV:CONFIG"

```

Note: The environmental variable must contain a valid JSON configuration in the same way that a file configuration should be.

### Rate Limit Bypass for Vanilla's Infrastructure

[](#rate-limit-bypass-for-vanillas-infrastructure)

If the destination is type `vanilla`, you might want to use the `rate_limit_bypass_token` (optional) configuration parameter to set your rate limit bypass token.

### Users and Authors

[](#users-and-authors)

When porter import articles it is searching for existing user by `email` and uses it if found.

If user is not found by email porter checks configuration feature flag `syncUserByEmailOnly` and if that flag is false (dafault) search user by `name`.

If user still can not be found porter will create new user.

### Import from multiple domains

[](#import-from-multiple-domains)

In case we need to import data from different domains and they all could be reached using same api credentials/token there is another tool `mulit-import.sh`.

This script get one argument which is folder name with special configuration file. For example `gink`.

That folder should have 2 files inside: `template.json` and `domains`. [![Screen Shot 2020-03-25 at 5 22 12 PM](https://user-images.githubusercontent.com/15682507/77586847-3842d600-6ebd-11ea-8d18-0c27dbb8bfef.png)](https://user-images.githubusercontent.com/15682507/77586847-3842d600-6ebd-11ea-8d18-0c27dbb8bfef.png)

`template.json` is regular config json file for this porter. but with 2 special values `prefix` and `source-domain` :

```
{
 "source": {
        "type": "zendesk",
        "foreignIDPrefix": "{prefix}",
        "domain": "{source-domain}",
        ...
  },
 "destination": {
        "type": "vanilla",
        ...
    }
}

```

and `domains` file has very flat structure `domain.com=prefix` like:

```
diamond.gink.com=diamond
digger.gink.com=digger
betty.gink.com=betty

```

This bash script will:

- read `domains` and loop trough
- get each domain and prefix value
- copy `template.json` to `/conf` subfolder with new name. Eg: `diamond.gink.com.json`
- substitute `prefix` and `source-domain` in that new configuration file
- run `knowledge-porter` command in background with this per domain prepared config

Example:

```
./bin/multi-import.sh gink

```

This `multi-import` script starts many php processes in background (one process per domain).

We can check progress using various log files created by this tool in targeted `{folder}/log`.

There is one special log file `{folder}/log/import.log`.

It has PIDs of running php processes in case developer need to stop them or investigate any incident.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~88 days

Recently: every ~166 days

Total

20

Last Release

537d ago

Major Versions

v1.2.4 → v2.02023-01-30

PHP version history (2 changes)v1.0.0PHP &gt;=7.2

v2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea17fedfd653c4692cf93a4faada50927cef9537dafed0dd4b1517e54fd71728?d=identicon)[charrondev](/maintainers/charrondev)

---

Top Contributors

[![OlivierLamyCanuel](https://avatars.githubusercontent.com/u/39598345?v=4)](https://github.com/OlivierLamyCanuel "OlivierLamyCanuel (58 commits)")[![alex-mtl](https://avatars.githubusercontent.com/u/15682507?v=4)](https://github.com/alex-mtl "alex-mtl (55 commits)")[![charrondev](https://avatars.githubusercontent.com/u/1770056?v=4)](https://github.com/charrondev "charrondev (24 commits)")[![cchabilall83](https://avatars.githubusercontent.com/u/36996270?v=4)](https://github.com/cchabilall83 "cchabilall83 (18 commits)")[![tburry](https://avatars.githubusercontent.com/u/97432?v=4)](https://github.com/tburry "tburry (15 commits)")[![vanilla-dbarbier](https://avatars.githubusercontent.com/u/61435952?v=4)](https://github.com/vanilla-dbarbier "vanilla-dbarbier (13 commits)")[![egarciajulia](https://avatars.githubusercontent.com/u/44788295?v=4)](https://github.com/egarciajulia "egarciajulia (4 commits)")[![acharron-hl](https://avatars.githubusercontent.com/u/146114816?v=4)](https://github.com/acharron-hl "acharron-hl (1 commits)")

---

Tags

production

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vanilla-knowledge-porter/health.svg)

```
[![Health](https://phpackages.com/badges/vanilla-knowledge-porter/health.svg)](https://phpackages.com/packages/vanilla-knowledge-porter)
```

###  Alternatives

[nunomaduro/phpinsights

Instant PHP quality checks from your console.

5.6k10.8M426](/packages/nunomaduro-phpinsights)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.0M273](/packages/league-climate)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
