Craft 3

Sprout Import installation and update instructions for Craft 2.

Requirements

  • Craft CMS 3.0.0 or a more recent version of Craft

Installation via Plugin Store

  1. Find the plugin in the Plugin Store in your Craft Control Panel
  2. Go to Settings → Plugins and select “Install”

Installation via Composer

  1. Open your terminal and go to your Craft project:
    cd /path/to/project
  2. Then tell Composer to load the plugin:
    composer require barrelstrength/sprout-import
  3. In the Control Panel, go to Settings → Plugins and select “Install”

Upgrading to Craft 3

BEFORE YOU UPDATE

Make sure you have updated to the latest version of Sprout Import 0.x before updating to Sprout Import 1.x for Craft 3

The syntax for importing data using Sprout Import is slightly different between Craft 3 and Craft 2. As the only attribute that differs is the @model attribute, the examples throughout the docs are shown with Craft 3 syntax and this page is referenced to clarify the differences between Craft 2 and Craft 3.

In Craft 3, the @model attribute should reference the full class name of the Importer. In Craft 2, as Craft did not yet support namespaces in plugins, @import just uses the short class name of the Importer.

@model syntax

[   {     "@model": "barrelstrength\\sproutbase\\app\\import\\importers\\elements\\Entry",     "attributes": { ... },     "content": { ... }   } ] 

Additional Examples

"@model": "barrelstrength\\sproutbase\\app\\import\\importers\\elements\\Entry" "@model": "barrelstrength\\sproutbase\\app\\import\\importers\\elements\\Category" "@model": "barrelstrength\\sproutbase\\app\\import\\importers\\elements\\User" "@model": "barrelstrength\\sproutbase\\app\\import\\importers\\settings\\Field" "@model": "barrelstrength\\sproutbase\\app\\import\\importers\\settings\\Section" "@model": "barrelstrength\\sproutbase\\app\\import\\importers\\settings\\Widget" 

See the /examples folder within each respective plugin for more examples.

Other Considerations

Craft 3 now uses Sites in place of Locales. All localeId and other Locale references will need to be updated to use siteId and respective Site references.

Upgrading to v1.0.0-beta.17

Sprout Import v1.0.0-beta.17 includes a breaking change that will require you to update any @model namespaces. This update to the application structure was made to add more flexible import, seeding, and more to all plugins within the Sprout Plugin Suite.

Previous NamespaceNew Namespace
barrelstrength\sproutimport\importers\elements\Assetbarrelstrength\sproutbase\app\import\importers\elements\Asset
barrelstrength\sproutimport\importers\elements\Categorybarrelstrength\sproutbase\app\import\importers\elements\Category
barrelstrength\sproutimport\importers\elements\Entrybarrelstrength\sproutbase\app\import\importers\elements\Entry
barrelstrength\sproutimport\importers\elements\Orderbarrelstrength\sproutbase\app\import\importers\elements\Order
barrelstrength\sproutimport\importers\elements\Productbarrelstrength\sproutbase\app\import\importers\elements\Product
barrelstrength\sproutimport\importers\elements\Tagbarrelstrength\sproutbase\app\import\importers\elements\Tag
barrelstrength\sproutimport\importers\elements\Userbarrelstrength\sproutbase\app\import\importers\elements\User
barrelstrength\sproutimport\importers\fields\Assetsbarrelstrength\sproutbase\app\import\importers\fields\Assets
barrelstrength\sproutimport\importers\fields\Categoriesbarrelstrength\sproutbase\app\import\importers\fields\Categories
barrelstrength\sproutimport\importers\fields\Checkboxesbarrelstrength\sproutbase\app\import\importers\fields\Checkboxes
barrelstrength\sproutimport\importers\fields\Colorbarrelstrength\sproutbase\app\import\importers\fields\Color
barrelstrength\sproutimport\importers\fields\Datebarrelstrength\sproutbase\app\import\importers\fields\Date
barrelstrength\sproutimport\importers\fields\Dropdownbarrelstrength\sproutbase\app\import\importers\fields\Dropdown
barrelstrength\sproutimport\importers\fields\Emailbarrelstrength\sproutbase\app\import\importers\fields\Email
barrelstrength\sproutimport\importers\fields\Entriesbarrelstrength\sproutbase\app\import\importers\fields\Entries
barrelstrength\sproutimport\importers\fields\Lightswitchbarrelstrength\sproutbase\app\import\importers\fields\Lightswitch
barrelstrength\sproutimport\importers\fields\Matrixbarrelstrength\sproutbase\app\import\importers\fields\Matrix
barrelstrength\sproutimport\importers\fields\MultiSelectbarrelstrength\sproutbase\app\import\importers\fields\MultiSelect
barrelstrength\sproutimport\importers\fields\Numberbarrelstrength\sproutbase\app\import\importers\fields\Number
barrelstrength\sproutimport\importers\fields\PlainTextbarrelstrength\sproutbase\app\import\importers\fields\PlainText
barrelstrength\sproutimport\importers\fields\RadioButtonsbarrelstrength\sproutbase\app\import\importers\fields\RadioButtons
barrelstrength\sproutimport\importers\fields\Redactorbarrelstrength\sproutbase\app\import\importers\fields\Redactor
barrelstrength\sproutimport\importers\fields\Tablebarrelstrength\sproutbase\app\import\importers\fields\Table
barrelstrength\sproutimport\importers\fields\Tagsbarrelstrength\sproutbase\app\import\importers\fields\Tags
barrelstrength\sproutimport\importers\fields\Urlbarrelstrength\sproutbase\app\import\importers\fields\Url
barrelstrength\sproutimport\importers\fields\Usersbarrelstrength\sproutbase\app\import\importers\fields\Users
barrelstrength\sproutimport\importers\settings\EntryTypebarrelstrength\sproutbase\app\import\importers\settings\EntryType
barrelstrength\sproutimport\importers\settings\Fieldbarrelstrength\sproutbase\app\import\importers\settings\Field
barrelstrength\sproutimport\importers\settings\Sectionbarrelstrength\sproutbase\app\import\importers\settings\Section
barrelstrength\sproutimport\importers\settings\UserGroupbarrelstrength\sproutbase\app\import\importers\settings\UserGroup
barrelstrength\sproutimport\importers\settings\Widgetbarrelstrength\sproutbase\app\import\importers\settings\Widget