dgrigg / craft-migration-assistant

Migration Manager for Craft CMS
Other
27 stars 10 forks source link

Latest craft cms(3.5.8) and migration assistant(3.1.9) not migrating any changes #28

Closed shyam-icode-developer closed 4 years ago

shyam-icode-developer commented 4 years ago

Hi Team,

We are facing issues when we upgrade our craft to the latest version and also the migration assistant but there seems to be some incompatibility in between the two.

We are always getting the below issue: The site has been restored to the state it was in before the attempted migration.

An error occurred while executing the "craft\contentmigrations\m200903_004207_migration_navigation_items migration: Setting unknown property: craft\fieldlayoutelements\CustomField::fieldHandle

This issue has been seen mainly when we link fields with layouts and then try to migrate the changes. migration_issue

Please can you help us in resolving this issue.

Many thanks in advance.

dgrigg commented 4 years ago

@shyam089 which version of Craft and which version of Migration Manager are you running.

shyam-icode-developer commented 4 years ago

craft cms(3.5.8) and migration assistant(3.1.9)

dgrigg commented 4 years ago

in your log file can you find the error and send me the details above that line that point to the file/line number.

dgrigg commented 4 years ago

Also, what type of field are you trying to migrate? Or it this happening with all of them?

shyam-icode-developer commented 4 years ago

Its happening with all kinds of fields. Whenever we link any field in section and try to migrate both. Its not migrating in other systems. Can you tell me which log file should I look for this error?

dgrigg commented 4 years ago

storage/logs/web.log

dgrigg commented 4 years ago

Is this happening when you are creating the migrations on the source system or when you are running the migration on the destination system?

shyam-icode-developer commented 4 years ago

Its coming when we run the migrations in the destination system. Give me a minute I'm sending the logs.

shyam-icode-developer commented 4 years ago

2020-09-04 07:20:33 [-][1][88nbcnhn7p2ta4ejmns9le7te7][trace][yii\db\Transaction::rollBack] Roll back transaction 2020-09-04 07:20:33 [-][1][88nbcnhn7p2ta4ejmns9le7te7][error][craft\db\MigrationManager::migrateUp] Failed to apply m200902_052941_migration_lunch_tips (time: 0.107s). Output: Exception: Setting unknown property: craft\fieldlayoutelements\CustomField::fieldHandle (/var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/BaseObject.php:163)

0 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\BaseObject->__set('fieldHandle', 'lunchTipsTeaser...')

1 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\fieldlayoutelements\CustomField), Array)

2 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(59): yii\base\BaseObject->__construct(Array)

3 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(40): craft\fieldlayoutelements\BaseField->__construct(Array)

4 [internal function]: craft\fieldlayoutelements\CustomField->__construct(NULL, Array)

5 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)

6 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\fieldlayo...', Array, Array)

7 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\fieldlayo...', Array, Array)

8 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/services/Fields.php(1178): yii\BaseYii::createObject(Array)

shyam-icode-developer commented 4 years ago

These are the logs I found where the transaction was rolled back to previous state. Let me know if you need some more information.

I would really appreciate your help.

dgrigg commented 4 years ago

Has the destination system been updated to latest Craft version before running the migrations?

shyam-icode-developer commented 4 years ago

Yes both systems are running on same craft version.

dgrigg commented 4 years ago

Can you provide more lines from the log files, after lines #0 - #8 so I can see where the error is originating.

shyam-icode-developer commented 4 years ago

Below is the track till #32, it's having.

2020-09-04 07:20:33 [-][1][88nbcnhn7p2ta4ejmns9le7te7][trace][yii\db\Transaction::rollBack] Roll back transaction 2020-09-04 07:20:33 [-][1][88nbcnhn7p2ta4ejmns9le7te7][error][craft\db\MigrationManager::migrateUp] Failed to apply m200902_052941_migration_lunch_tips (time: 0.107s). Output: Exception: Setting unknown property: craft\fieldlayoutelements\CustomField::fieldHandle (/var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/BaseObject.php:163)

0 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\BaseObject->__set('fieldHandle', 'lunchTipsTeaser...')

1 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\fieldlayoutelements\CustomField), Array)

2 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(59): yii\base\BaseObject->__construct(Array)

3 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(40): craft\fieldlayoutelements\BaseField->__construct(Array)

4 [internal function]: craft\fieldlayoutelements\CustomField->__construct(NULL, Array)

5 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)

6 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\fieldlayo...', Array, Array)

7 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\fieldlayo...', Array, Array)

8 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/services/Fields.php(1178): yii\BaseYii::createObject(Array)

9 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/models/FieldLayoutTab.php(137): craft\services\Fields->createLayoutElement(Array)

10 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\models\FieldLayoutTab->init()

11 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/models/FieldLayout.php(234): yii\base\BaseObject->__construct(Array)

12 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/services/BaseMigration.php(251): craft\models\FieldLayout->setTabs(Array)

13 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/services/Sections.php(253): dgrigg\migrationassistant\services\BaseMigration->createFieldLayout(Array)

14 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/services/Sections.php(145): dgrigg\migrationassistant\services\Sections->createEntryType(Array, Object(craft\models\Section))

15 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/services/BaseMigration.php(151): dgrigg\migrationassistant\services\Sections->importItem(Array)

16 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/services/Migrations.php(255): dgrigg\migrationassistant\services\BaseMigration->import(Array)

17 /var/www/html/bleckmann_pwa/backend/migrations/m200902_052941_migration_lunch_tips.php(40): dgrigg\migrationassistant\services\Migrations->import(Array)

18 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/db/Migration.php(52): craft\contentmigrations\m200902_052941_migration_lunch_tips->safeUp()

19 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/db/MigrationManager.php(232): craft\db\Migration->up(true)

20 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/services/Migrations.php(336): craft\db\MigrationManager->migrateUp(Object(craft\contentmigrations\m200902_052941_migration_lunch_tips))

21 /var/www/html/bleckmann_pwa/backend/vendor/dgrigg/craft-migration-assistant/src/controllers/RunController.php(111): dgrigg\migrationassistant\services\Migrations->runMigrations(Array)

22 [internal function]: dgrigg\migrationassistant\controllers\RunController->actionMigrations()

23 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

24 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)

25 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/web/Controller.php(189): yii\base\Controller->runAction('migrations', Array)

26 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrations', Array)

27 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/web/Application.php(280): yii\base\Module->runAction('migrationassist...', Array)

28 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/web/Application.php(583): craft\web\Application->runAction('migrationassist...', Array)

29 /var/www/html/bleckmann_pwa/backend/vendor/craftcms/cms/src/web/Application.php(259): craft\web\Application->_processActionRequest(Object(craft\web\Request))

30 /var/www/html/bleckmann_pwa/backend/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))

31 /var/www/html/bleckmann_pwa/backend/web/index.php(22): yii\base\Application->run()

32 {main}

dgrigg commented 4 years ago

@shyam089 try release 3.2.0

shyam-icode-developer commented 4 years ago

thanks @dgrigg , I will install and try once. Really appreciate your help and time.

shyam-icode-developer commented 4 years ago

Hi @dgrigg , I tried your latest release 3.2.0 but its showing something else now.. An error occurred while executing the "craft\contentmigrations\m200904_090855_migration_mail_template migration: Trying to get property 'uid' of non-object

shyam-icode-developer commented 4 years ago

Below you can find the stack trace for the same, 2020-09-04 22:59:27 [-][1][-][error][craft\db\MigrationManager::migrateUp] Failed to apply m200904_090855_migration_mail_template (time: 0.515s). Output: Exception: Trying to get property 'uid' of non-object (/var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php:98)

0 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/web/ErrorHandler.php(76): yii\base\ErrorHandler->handleError()

1 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(98): craft\web\ErrorHandler->handleError()

2 /var/www/html/bcrew_test/backend/vendor/yiisoft/yii2/base/BaseObject.php(136): craft\fieldlayoutelements\CustomField->getFieldUid()

3 /var/www/html/bcrew_test/backend/vendor/yiisoft/yii2/base/ArrayableTrait.php(126): yii\base\BaseObject->__get()

4 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/models/FieldLayoutTab.php(189): craft\base\FieldLayoutElement->toArray()

5 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/models/FieldLayoutTab.php(175): craft\models\FieldLayoutTab->getElementConfigs()

6 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/models/FieldLayout.php(369): craft\models\FieldLayoutTab->getConfig()

7 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/models/EntryType.php(212): craft\models\FieldLayout->getConfig()

8 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/services/Sections.php(1104): craft\models\EntryType->getConfig()

9 /var/www/html/bcrew_test/backend/vendor/dgrigg/craft-migration-assistant/src/services/Sections.php(147): craft\services\Sections->saveEntryType()

10 /var/www/html/bcrew_test/backend/vendor/dgrigg/craft-migration-assistant/src/services/BaseMigration.php(151): dgrigg\migrationassistant\services\Sections->importItem()

11 /var/www/html/bcrew_test/backend/vendor/dgrigg/craft-migration-assistant/src/services/Migrations.php(255): dgrigg\migrationassistant\services\BaseMigration->import()

12 /var/www/html/bcrew_test/backend/migrations/m200904_090855_migration_mail_template.php(37): dgrigg\migrationassistant\services\Migrations->import()

13 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/db/Migration.php(52): craft\contentmigrations\m200904_090855_migration_mail_template->safeUp()

14 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/db/MigrationManager.php(232): craft\db\Migration->up()

15 /var/www/html/bcrew_test/backend/vendor/dgrigg/craft-migration-assistant/src/services/Migrations.php(336): craft\db\MigrationManager->migrateUp()

16 /var/www/html/bcrew_test/backend/vendor/dgrigg/craft-migration-assistant/src/controllers/RunController.php(111): dgrigg\migrationassistant\services\Migrations->runMigrations()

17 [internal function]: dgrigg\migrationassistant\controllers\RunController->actionMigrations()

18 /var/www/html/bcrew_test/backend/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()

19 /var/www/html/bcrew_test/backend/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()

20 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/web/Controller.php(189): yii\base\Controller->runAction()

21 /var/www/html/bcrew_test/backend/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction()

22 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/web/Application.php(280): yii\base\Module->runAction()

23 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/web/Application.php(583): craft\web\Application->runAction()

24 /var/www/html/bcrew_test/backend/vendor/craftcms/cms/src/web/Application.php(259): craft\web\Application->_processActionRequest()

25 /var/www/html/bcrew_test/backend/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()

26 /var/www/html/bcrew_test/backend/web/index.php(22): yii\base\Application->run()

27 {main}

dgrigg commented 4 years ago

@shyam089 does the field(s) that are in the section you are trying to migrate exist on the destination site? Is it possible you are doing a section migration before migrating the fields?

shyam-icode-developer commented 4 years ago

I created the single migration file by selecting fields as well as there respective sections also from both tabs. I'm not sure if plugin is applying the sections handler first while importing.

dgrigg commented 4 years ago

try doing two separate migrations, one for the fields first and then one for the sections second

shyam-icode-developer commented 4 years ago

OK, Just give me 2 mins.I will try that one.

shyam-icode-developer commented 4 years ago

@dgrigg , I tried doing it separately but its working only if my fields are not linked to the sections, In case If its linked already then even if we do migrations seprately, its throwing error like that section is missing.

shyam-icode-developer commented 4 years ago

In this scenario, what happens we need to link our fields manually then in the destination system. But previously with craft 3.4.8 and migration-assistant 3.1.8 it used migrate both simultaneously without issues.

dgrigg commented 4 years ago

Let me see what I can do. Craft 3.5 has introduced a few changes that are proving tricky to work around.

shyam-icode-developer commented 4 years ago

Yes, I too saw some database changes has come, so I was in contact with one of the craft support member as well, if he can help me. I would really be thankful for your help and support.

dgrigg commented 4 years ago

One more question. Is the field that links to a section, linking to the section that it is a field in (like a circular reference).

ie Field['sectionField']['section'] = 'SectionA'

Section['SectionA']['fields'] = ['title', 'sectionField', 'someOtherField']

shyam-icode-developer commented 4 years ago

@dgrigg , No Its not circular linking in my case, But if I see my migrations files which I created only for fields, its mentioned "typesettings":{"sources":["tokenSection"] , like the field is linked to some section, hence if I run migrations first for the field, it will throw error that section is not found so I have to first run for sections then only fields will be migrated.

For refrence you can check my both fields and sections migrations here.

{"settings":{"dependencies":[],"elements":{"fields":[{"group":"Email Templates","name":"Mail Template Handler","handle":"mailTemplateHandler","instructions":"","translationMethod":"language","translationKeyFormat":null,"required":null,"searchable":true,"type":"craft\fields\PlainText","typesettings":{"uiMode":"normal","placeholder":"handler name","code":"","multiline":"","initialRows":"4","charLimit":null,"byteLimit":null,"columnType":null}},{"group":"Email Templates","name":"MailContent","handle":"mailcontent","instructions":"","translationMethod":"site","translationKeyFormat":null,"required":null,"searchable":true,"type":"craft\fields\Matrix","typesettings":{"minBlocks":"1","maxBlocks":"1","contentTable":"{{%matrixcontent_mailcontent}}","propagationMethod":"all","blockTypes":{"new1":{"name":"Mail Content Section","handle":"mailcontentblock","fields":{"new1":{"name":"Subject","handle":"subject","instructions":"","required":true,"type":"craft\fields\PlainText","translationMethod":"language","translationKeyFormat":null,"typesettings":{"uiMode":"normal","placeholder":"Add your subject","code":"","multiline":"","initialRows":"4","charLimit":null,"byteLimit":null,"columnType":null}},"new2":{"name":"Body","handle":"body","instructions":"","required":false,"type":"craft\redactor\Field","translationMethod":"language","translationKeyFormat":null,"typesettings":{"uiMode":"enlarged","redactorConfig":"Standard.json","purifierConfig":"","cleanupHtml":true,"removeInlineStyles":"","removeEmptyTags":"","removeNbsp":"","purifyHtml":"","columnType":"text","availableVolumes":"","availableTransforms":"","showUnpermittedVolumes":false,"showUnpermittedFiles":false,"showHtmlButtonForNonAdmins":true,"configSelectionMode":"choose","manualConfig":"","defaultTransform":""}},"new3":{"name":"MailContentTokens","handle":"mailcontenttokens","instructions":"","required":false,"type":"craft\fields\Entries","translationMethod":"site","translationKeyFormat":null,"typesettings":{"sources":["tokenSection"],"source":null,"targetSiteId":null,"viewMode":null,"limit":"","selectionLabel":"Select token","showSiteMenu":true,"localizeRelations":false,"validateRelatedElements":false,"allowSelfRelations":false}}}}}}},{"group":"Email Templates","name":"Token Description","handle":"tokenDescription","instructions":"","translationMethod":"language","translationKeyFormat":null,"required":null,"searchable":true,"type":"craft\fields\PlainText","typesettings":{"uiMode":"normal","placeholder":"Add token (starts with ! , ex: !url)","code":"","multiline":"","initialRows":"4","charLimit":null,"byteLimit":null,"columnType":null}}]}}}

Next this one is for the sections: {"settings":{"dependencies":{"sections":[{"name":"Mail Content Section","handle":"mailContentSection","type":"channel","enableVersioning":true,"propagationMethod":"all","sites":{"default":{"site":"default","hasUrls":true,"uriFormat":"mail-content-section/{slug}","enabledByDefault":true,"template":null},"bcrewNl":{"site":"bcrewNl","hasUrls":true,"uriFormat":"mail-content-section/{slug}","enabledByDefault":true,"template":null},"bcrewFr":{"site":"bcrewFr","hasUrls":true,"uriFormat":"mail-content-section/{slug}","enabledByDefault":true,"template":null}},"entrytypes":[{"sectionHandle":"mailContentSection","hasTitleField":true,"name":"Mail Content Section","handle":"mailContentSection","requiredFields":[],"fieldLayouts":{"tabs":[{"name":"Content","sortOrder":1,"elements":[{"type":"craft\fieldlayoutelements\EntryTitleField","autocomplete":false,"class":null,"size":null,"name":null,"autocorrect":true,"autocapitalize":true,"disabled":false,"readonly":false,"title":null,"placeholder":null,"step":null,"min":null,"max":null,"requirable":false,"id":null,"containerAttributes":[],"inputContainerAttributes":[],"labelAttributes":[],"orientation":null,"label":"Mail template","instructions":"","tip":null,"warning":null,"width":100}]}]}}]},{"name":"Token Section","handle":"tokenSection","type":"channel","enableVersioning":true,"propagationMethod":"all","sites":{"default":{"site":"default","hasUrls":true,"uriFormat":"token-section/{slug}","enabledByDefault":true,"template":null},"bcrewNl":{"site":"bcrewNl","hasUrls":true,"uriFormat":"token-section/{slug}","enabledByDefault":true,"template":null},"bcrewFr":{"site":"bcrewFr","hasUrls":true,"uriFormat":"token-section/{slug}","enabledByDefault":true,"template":null}},"entrytypes":[{"sectionHandle":"tokenSection","hasTitleField":true,"titleFormat":"{tokens}","name":"Tokens","handle":"tokens","requiredFields":[],"fieldLayouts":{"tabs":[{"name":"token content","sortOrder":1,"elements":[{"type":"craft\fieldlayoutelements\EntryTitleField","autocomplete":false,"class":null,"size":null,"name":null,"autocorrect":true,"autocapitalize":true,"disabled":false,"readonly":false,"title":null,"placeholder":null,"step":null,"min":null,"max":null,"requirable":false,"id":null,"containerAttributes":[],"inputContainerAttributes":[],"labelAttributes":[],"orientation":null,"label":"Token","instructions":"Start with !","tip":null,"warning":null,"width":100}]}]}}]}]},"elements":{"sections":[{"name":"Mail Content Section","handle":"mailContentSection","type":"channel","enableVersioning":true,"propagationMethod":"all","sites":{"default":{"site":"default","hasUrls":true,"uriFormat":"mail-content-section/{slug}","enabledByDefault":true,"template":null},"bcrewNl":{"site":"bcrewNl","hasUrls":true,"uriFormat":"mail-content-section/{slug}","enabledByDefault":true,"template":null},"bcrewFr":{"site":"bcrewFr","hasUrls":true,"uriFormat":"mail-content-section/{slug}","enabledByDefault":true,"template":null}},"entrytypes":[{"sectionHandle":"mailContentSection","hasTitleField":true,"name":"Mail Content Section","handle":"mailContentSection","requiredFields":[],"fieldLayouts":{"tabs":[{"name":"Content","sortOrder":1,"elements":[{"type":"craft\fieldlayoutelements\EntryTitleField","autocomplete":false,"class":null,"size":null,"name":null,"autocorrect":true,"autocapitalize":true,"disabled":false,"readonly":false,"title":null,"placeholder":null,"step":null,"min":null,"max":null,"requirable":false,"id":null,"containerAttributes":[],"inputContainerAttributes":[],"labelAttributes":[],"orientation":null,"label":"Mail template","instructions":"","tip":null,"warning":null,"width":100}]}]}}]},{"name":"Token Section","handle":"tokenSection","type":"channel","enableVersioning":true,"propagationMethod":"all","sites":{"default":{"site":"default","hasUrls":true,"uriFormat":"token-section/{slug}","enabledByDefault":true,"template":null},"bcrewNl":{"site":"bcrewNl","hasUrls":true,"uriFormat":"token-section/{slug}","enabledByDefault":true,"template":null},"bcrewFr":{"site":"bcrewFr","hasUrls":true,"uriFormat":"token-section/{slug}","enabledByDefault":true,"template":null}},"entrytypes":[{"sectionHandle":"tokenSection","hasTitleField":true,"titleFormat":"{tokens}","name":"Tokens","handle":"tokens","requiredFields":[],"fieldLayouts":{"tabs":[{"name":"token content","sortOrder":1,"elements":[{"type":"craft\fieldlayoutelements\EntryTitleField","autocomplete":false,"class":null,"size":null,"name":null,"autocorrect":true,"autocapitalize":true,"disabled":false,"readonly":false,"title":null,"placeholder":null,"step":null,"min":null,"max":null,"requirable":false,"id":null,"containerAttributes":[],"inputContainerAttributes":[],"labelAttributes":[],"orientation":null,"label":"Token","instructions":"Start with !","tip":null,"warning":null,"width":100}]}]}}]}]}}}

dgrigg commented 4 years ago

@shyam089 I just pushed some updates (3.2.1). I think the issue is the order of migrations. I was able to make the error happen locally and following the steps below worked to prevent the error. The problem is the order of fields/sections existing in Craft and what happens internally if a field/section fails validation when saving.

Try the following in instances where you have a field that contains a reference to a section.

  1. If the section being referenced does not exist on the destination server, create a migration for the referenced section
  2. Create a separate migration for the field(s) referencing the section
  3. Create a separate migration for the new section(s) that use the field(s) from step 2.

On the destination server run each migration independently by selecting each one (in the order from above) and running it in the 'Pending Migrations' list.

shyam-icode-developer commented 4 years ago

@dgrigg , Thanks for your time, I will try it the way the you suggested to see if its successfully migrating.

shyam-icode-developer commented 4 years ago

@dgrigg , Thank you much the issue is resolved now and its migrating again.