This plugin allows administrators to easily import data from a blog-like CMS. You can import information like pages, posts, comments, categories & tags. The plugin is constructed in a modular way, the base plugin only contains abstracted data definitions. To import data, you also need to install the appropriate drivers for your source and destination.
What drivers are available?
Sources:
- WordPress
Destinations:
- Pages
- RainLab.Blog
Requirements
- PHP 7.2 or higher
Getting started
Please refer to the documentation.
Questions? Need help?
If you have any question about how to use this plugin, please don't hesitate to contact us at octobercms@vdlp.nl. We're happy to help you. You can also visit the support forum and drop your questions/issues there.
If you love this quality plugin as much as we do, please rate our plugin.
The following plugins extend or depend on the plugin

Import: Pages
Adds October CMS pages import functionality to the Import plugin. This destination driver can import pages.
Import: Pages
Adds October CMS pages import functionality to the Import plugin. This destination driver can import pages.

Import: Rainlab Blog
Adds RainLab Blog import functionality to the Vdlp.Import plugin (import posts and categories).
Import: Rainlab Blog
Adds RainLab Blog import functionality to the Vdlp.Import plugin (import posts and categories).

Import: WordPress
Adds WordPress import functionality to the Vdlp.Import plugin (import official WordPress exports).
Import: WordPress
Adds WordPress import functionality to the Vdlp.Import plugin (import official WordPress exports).
Table of Contents
- Requirements
- Optional Requirements
- Installation
- Creating an import
- Editing an import
- Deleting an import
- Running an import
- Rolling back an import
- Setting up live logging
- Creating a Source Driver
- Creating a Destination Driver
Requirements
- PHP 7.2 or higher
Installation
Install the plugin from CLI using this command:
php artisan plugin:install Vdlp.Import
Or install it from the October Marketplace. And update dependencies from root of your OctoberCMS project.
Creating an import
NOTE: Before creating an import you must have at least one Source Driver and one Destination Driver installed. Please see drivers for possible drivers.
- Go to the Vdlp.Import tab in the backend.
- Click the
+ New Import
button. - Under the
Source
field select the Source Driver from which you want data imported. - Under the
File
field, upload the export file corresponding with your source driver.
The Vdlp.Import plugin will now look for all items found in the source file, and display switches for each type when there is atleast one of said type found. Numbers with the amount items with this types is also displayed.
- Switch all the switches to
ON
for all the types you wish to import.
Tabs will now be shown for each of the individual types you switched to ON
you can further configure per-type options here.
- Further configure the individual types.
- Either click
Create and run
to immediately execute your import or clickCreate and close
to run your import later.
Editing an import
NOTE: You can only edit imports that have not been run.
- Go to the Vdlp.Import tab in the backend.
- Click the
Edit
button next to the import you wish to edit. - Edit the import.
Deleting an import
NOTE: You can only delete imports that have not been run.
- Go to the Vdlp.Import tab in the backend.
- Click the
Delete
button next to the import you wish to delete.
Running an import
- Go to the Vdlp.Import tab in the backend.
- Click the
Run
import next to the import you wish to run. - Click on the
Run import
button. - Wait until the import finishes.
Rolling back an import
NOTE: You can only roll back imports that have already been run.
- Go to the Vdlp.Import tab in the backend.
- Click on the
Rollback
button on the import you wish to roll back.
Creating a Source Driver
If you wish to create a new source driver for a CMS that does not yet have one, you can do so by following these steps:
- Create a new class.
- Make it implement the
Vdlp\Import\Classes\Contracts\SourceDriver
interface. - Implement the methods accordingly:
getName
Must return the driver name (For example'WordPress'
).getDescription
Must return a driver description.getIcon
Can return an OctoberCMS icon string for displaying a icon in the dropdown and list (For example'oc-icon-wordpress'
).getAllowedExportMimeTypes
Should return an array of mime types that the export file from the source CMS can be in. For example['text/xml']
.getAllowedExportExtensions
Should return an array of extensions that the export file can be in. For example['xml']
.start
Can be implemented to do something when the import starts.finish
Can be implemented to do something when the import finishes.supportsFoo
Must return a boolean that designates whether the source returns an item with the typeFoo
. For example a Post or Page.getParsed
Is the main method that will parse the Source file and return a Source object containing all the Posts, Pages, Categories and Tags that the Source driver provides.
- Register the Source Driver with the Vdlp.Import plugin:
use System\Classes\PluginBase; use Vdlp\Import\Classes\Importer; class Plugin extends PluginBase { public function boot() { app(Importer::class)->extend('foo', function () { return new SourceDriverClass(); }); } }
OR with the Facade:
use System\Classes\PluginBase; use Vdlp\Import\Classes\Facades\Import; class Plugin extends PluginBase { public function boot() { Import::extend('foo', function () { return new SourceDriverClass(); }); } }
Creating a Destination Driver
If you wish to create a new destination driver for importing content for a model that does not yet have a driver associated with it, you can do so by following these steps:
- Create a new class.
- Make it implement the
Vdlp\Import\Classes\Contracts\DestinationDriver
interface. - Implement the methods accordingly:
getName
Must return the driver name (For example'Pages'
).getDescription
Must return a driver description.getIcon
Can return an OctoberCMS icon string for displaying a icon in the dropdown and list.supportsFoo
Must return a boolean that designates whether the destination can handle an item with the typeFoo
. For example a Post or Page.insertFoo
The actual method for creating the object that the Driver is for. Supplies aSource
object that the desired properties can be gathered out of. Must return the created OctoberCMS model.findFoo
Finds an existing model depending on aSource
object. Must return it if found, otherwisenull
.associateContentBearerTaxonomy
Method for associating a Content Bearer (Post/Page) with a taxonomy (Category/Tag). Returns the status, if the association was made properly. You can returnfalse
if your destination does not support associating Content Bearers with taxonomies or does not have taxonomies at all you can returnfalse
.associateParentChildTaxonomy
Method for associating the parent-child relation of a taxonomy (Category/Tag). Returns the status, if your destination does not support parent-child relations in taxonomies, or does support taxonomies at all you can returnfalse
.onRollBack
Optional method that gets called when a rollback starts. Can be used to delete additional items in the Import like files.
- Register the Destination Driver with the Vdlp.Import plugin:
use System\Classes\PluginBase; use Vdlp\Import\Classes\Importer; class Plugin extends PluginBase { public function boot() { app(Importer::class)->extend('bar', function () { return new DestinationDriverClass(); }); } }
OR with the Facade:
use System\Classes\PluginBase; use Vdlp\Import\Classes\Facades\Import; class Plugin extends PluginBase { public function boot() { Import::extend('bar', function () { return new DestinationDriverClass(); }); } }
- Extend each of your destination model types with a new morphOne relation to the
Vdlp\Import\Models\Destination
model class asdestinationable
.
use System\Classes\PluginBase; use Vdlp\Import\Models\Destination; class Plugin extends PluginBase { public function boot() { DestinationModel::extend(function (DestinationModel $model) { $model->morphOne = [ 'destination' => [ Destination::class => 'destinationable', ], ]; }); } }
-
This plugin has not been reviewed yet.
-
1.0.1 |
Remove HTML markup from dropdown fields Jun 05, 2020 |
---|---|
1.0.0 |
First version of Vdlp.Import Aug 16, 2019 |