PHPackages                             anroots/minion-importer - 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. anroots/minion-importer

AbandonedArchivedKohana-module[CLI &amp; Console](/categories/cli)

anroots/minion-importer
=======================

CLI data import module for Kohana

1.0.1(13y ago)71.1k[1 issues](https://github.com/anroots/kohana-minion-importer/issues)MITPHPPHP &gt;=5.4.0

Since Feb 24Pushed 13y ago6 watchersCompare

[ Source](https://github.com/anroots/kohana-minion-importer)[ Packagist](https://packagist.org/packages/anroots/minion-importer)[ Docs](https://github.com/anroots/kohana-minion-importer)[ RSS](/packages/anroots-minion-importer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

CLI Data Import Module For Kohana
=================================

[](#cli-data-import-module-for-kohana)

Extends the [Minion](https://github.com/kohana/minion) module to provide a framework for importing/populating data.

[![Example terminal session](https://camo.githubusercontent.com/0866061bed8cb393f4da97a2fb8eba112371ea2f749a902392cf70771ab09ab2/68747470733a2f2f7261772e6769746875622e636f6d2f616e726f6f74732f6b6f68616e612d6d696e696f6e2d696d706f727465722f6d61737465722f53637265656e73686f742d312e706e67)](https://camo.githubusercontent.com/0866061bed8cb393f4da97a2fb8eba112371ea2f749a902392cf70771ab09ab2/68747470733a2f2f7261772e6769746875622e636f6d2f616e726f6f74732f6b6f68616e612d6d696e696f6e2d696d706f727465722f6d61737465722f53637265656e73686f742d312e706e67)

Two main use cases:

- Importing legacy data from external databases
- Generating dummy sample data

### Real world use case

[](#real-world-use-case)

You are tasked with creating a new version of your in-house issue tracker, from scratch. You design your new database model and now you need to import existing data from the old system. The schema has changed so the columns do not match one-to-one and maybe you want to filter out deleted issues and what-knot.

Use this module to help you do that. Simply define a `Minion_Import_*` model for your entity to do data fetching, mapping and filtering. [See example implementation for companies](https://github.com/anroots/kohana-minion-importer/blob/master/classes/Minion/Import/Company.php).

Usage
-----

[](#usage)

- Create class: `Minion_Import_Company`
- Implement `Minion_Import_Importable`
- Modify `APPPATH.'config/minion/import.php'` (copy sample from the module dir), add your new model to the `truncate_order` and `models` arrays
- Run `./minion import` from the CLI

Faker
-----

[](#faker)

Use [fzaninotto/Faker](https://github.com/fzaninotto/Faker) to generate dummy sample/test data with minion-importer.

Requires
--------

[](#requires)

- Kohana Framework 3.3
- PHP 5.4
- Minion, Database, ORM modules

Installation
------------

[](#installation)

### Place the files in your modules directory

[](#place-the-files-in-your-modules-directory)

#### As a Git submodule:

[](#as-a-git-submodule)

```
git clone git://github.com/anroots/kohana-minion-importer.git modules/minion-importer
```

#### As a [Composer dependency](http://getcomposer.org)

[](#as-a-composer-dependency)

```
{
	"require": {
		"anroots/minion-importer":"1.*"
	}
}
```

### Activate the module in `bootstrap.php`.

[](#activate-the-module-in-bootstrapphp)

```
