Questions tagged [install-script]

Denotes questions related to install scripts. Install scripts are scripts that are used for installation purposes. This installation may be of a software program or any other code routine.

Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

Too many arguments, expected arguments "command"

Hi, can anyone help to identify how to fix this? I am installing from a Magento 2.4 Script onto ubuntu 20.04. Thanks
user avatar
2 votes
3 answers
42 views

How to run the this code for Magento 2.3 version

I run the following code in magento2.3 but it's showing Class \Mastering\Itdesire\Setup\Mastering\Itdesire\Setup\InstallData does not exist error. Content of InstallData.php: <?php /* * To ...
user avatar
  • 21
0 votes
1 answer
30 views

InstallSchema Doesn't Run

I've got a module that has this InstallSchema: <?php namespace Vendor\Module\Setup; class InstallSchema implements \Magento\Framework\Setup\InstallSchemaInterface { public ...
user avatar
  • 121
0 votes
1 answer
662 views

Magento 2 how to add data to custom column in sales_order table

I wan't to add data in a custom field that I created, I used InstallSchema like this: Setup/InstallSchema.php use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\...
user avatar
0 votes
0 answers
116 views

How to create extension in Magento 2.3.3?

I am familiar with Magento 2 extension development but can anyone explain step by step extension development changes in Magento 2.3.3 by writing a simple "Hello_World" extension. In Magento 2.3.x no ...
user avatar
  • 2,154
3 votes
2 answers
2k views

Magento 2 : create view table via setup script

How do you create a view table via setup script Direct sql CREATE OR REPLACE VIEW... etc Or is there a magento way? Update Thanks for your suggestions so far. I'm asking whether possible to ...
user avatar
4 votes
0 answers
118 views

How to reinstall module without any downtime or trigger InstallSchema.php on already installed module?

I am trying to reinstall a module on Magento ver. 2.2.8 to trigger the InstallSchema.php of a module without any downtime. My question: Is there a way of reinstalling the module or at least running ...
user avatar
  • 2,739
0 votes
3 answers
326 views

Custom script leading to 404 in M2

I want to create a custom script for this I have created folder test on root and two files inside folder index.php , test.php My index.php Looks like require DIR . '../../app/bootstrap.php'; ...
user avatar
  • 630
2 votes
2 answers
1k views

How to check if column exist before trying to add it to the table?

We are using the Extension FollowUp E-Mail from AheadWorks. The Extension has bugs in the sql install scripts... they are trying to add a column to a table but don't check if the column does already ...
user avatar
  • 2,380
1 vote
0 answers
70 views

InstallScheme Script for dynamic rows Magento 2

I have created dynamic rows on product creation form. I have to save their value in custom table and retrieve as a dropdown on frontend product detail page w.r.t product ID. I am aware of the event ...
user avatar
  • 1,521
0 votes
1 answer
462 views

How to add a new field to Custom Options

How can I extend the "Custom Options" in a configurable product? I need to add a new field named Identifier. Where can I find the necessary templates? I figured out that the template is in app\design\...
user avatar
  • 2,380
0 votes
1 answer
52 views

Magento1 website Security patch installation by script

Magento1 my website i have installing following Security patch: Security patch 10975 Security patch 10415 Security patch 9767 Security patch 8788 Security patch 7405 but i want script in my root ...
user avatar
1 vote
1 answer
405 views

Magento 2 : Foreing key constraint issue

I'm trying to save records using the controller. I set foreign key in attribute_set_id and entity_type_id field in main table with eav_attribute_set and eav_entity_type respectivelly. But, when I ...
user avatar
1 vote
1 answer
1k views

Error Add Foreign Key Using Install Schema Magento 2

<?php namespace Magneto\BookFreeLayout\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\...
user avatar
0 votes
1 answer
165 views

adding custom attribute to category

I'm trying to add a new custom image attribute for category, following the guide here "https://webkul.com/blog/add-custom-image-attribute-category-magento-2/comment-page-1/#comment-16835" However, ...
user avatar
0 votes
0 answers
243 views

How to add a Megamenu programmatically in Magento 2?

I need to add Megamenu via an install/upgrade script. I've added my megamenu. I've figured out which tables get updated when I add Megamenu. The table which gets updated is mgs_megamenu ...
user avatar
  • 799
0 votes
1 answer
26 views

Is there a way to perform a silent installation of Magento through a bash code?

Is there a way to perform a silent installation of Magento through a bash code? This is what I have in my bash: ... ... PRJ_MAGENTO_PUBK=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx PRJ_MAGENTO_PRVK=...
user avatar
  • 189
2 votes
2 answers
982 views

Question about UpgradeSchema and UpgradeData files

Sorry, I'm new in using Magento 2. In my UpgradeSchema.php I would like to add a column to my table and in my UpgradeData.php I would like to add new records to the table. In both the file i have ...
user avatar
  • 21
2 votes
1 answer
663 views

how to add collation( utf8_general_ci) using install schema in magento2?

I want to create table using install schema in magento2 with column collation( utf8_general_ci) . how to do this?
user avatar
0 votes
2 answers
952 views

Magento 2 get database prefix on install data

How to get database table prefix on install data? It is showing "table or view not found". <?php namespace ...; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Setup\...
user avatar
1 vote
4 answers
253 views

InstallSchema.php not working in magento2

I have been trying to create a table from InstallSchema.php, but some reason the table is getting created. I haved created a bare minimum module with the following files. 1. registration.php <...
user avatar
  • 15
0 votes
1 answer
257 views

Magento 2 Custom module installation time create media directory

I want to create media directory with 777 recursive permission on custom module installation time, So I have created createDirectory function in InstallSchema. But currently directory is created with ...
user avatar
  • 1,683
2 votes
0 answers
101 views

Insert data into core db table

I need to run this SQL query on Magento, but since I have a multi-tenant solution, it need to be done through Data/Install scripts as it will run every time a new client comes in. What should I use? ...
user avatar
4 votes
1 answer
77 views

Custom Page Form and db insertion magento 2

I have created a custom Form and try to store details in databse. but the product url field and image url is not saved in db. app/code/Dyode/Pricebeat/Controller/User/Post.php <?php namespace ...
user avatar
0 votes
1 answer
276 views

Wrong attribute set ID Mage_Eav_Model_Entity_Setup

I have been receiving this error. Error: mysql4-install-1.0.php" - Wrong attribute set ID";i:1;s:1016:"#0 /Applications/MAMP/htdocs/flicdes/app/code/core/Mage/Core/Model/Resource/Setup.php(644): ...
user avatar
  • 3
1 vote
1 answer
483 views

Install script not running

I know there's a million of these questions with answers but I still can't solve this. It does create the line in the core_resource table, but my install script is supposed to die to show it's running,...
user avatar
0 votes
1 answer
220 views

Magento 1.9 add attribute to Credit memo item

I am trying to add a quantity to return to stock data to the credit memo item. I have made 2 install scripts. One adds a column to the database <?php $installer = $this; $installer->...
user avatar
0 votes
2 answers
289 views

How to create custom widget via Install?

I need to create widget category link via Upgrade. How to do this?
user avatar
  • 550
1 vote
0 answers
111 views

Magento 2 : Call a function at the time of module installation

I want to call a function to send some store information through api call at the time of my custom module installation. Is there any event observer for this? How can we do it? Thanks. class ...
user avatar
  • 53
0 votes
3 answers
3k views

Force-run module install script in Magento 2

I have added some install data to my module (EAV attributes), and it doesn't look like it's working. However, I don't seem to get any relevant errors in the logs, and am a bit lost on whether the ...
user avatar
  • 246
6 votes
2 answers
4k views

How to fix this "Running schema recurring.Unique constraint violation found"

How to fix this error "Running schema recurring.Unique constraint violation found". This statement occurs when I used upgrade command of Magento 2 model upgradation.
user avatar
3 votes
0 answers
341 views

Magento 2: Filter by custom product/category attribute returns 0 results

I created a bool (int) attribute with a default value of 0 for both category & product entities. I reindexed, cleared cache, etc... Now, no matter what I do, I can't filter the collection using ...
user avatar
  • 887
1 vote
5 answers
19k views

Magento 2 - Create product attribute programmatically

I have create product attribute of type select select with below configurations: $setup->addAttribute(\Magento\Catalog\Model\Product::ENTITY, 'attribute_code', [ 'attribute_model' =>...
user avatar
3 votes
2 answers
2k views

Recurring Upgrade Scripts in Magento 2.0, 2.1, or 2.2?

According to this dev doc (emphasis mine) InstallData and InstallSchema scripts, which are executed on a clean (empty) database UpgradeData and UpgradeSchema incremental scripts, which ...
user avatar
  • 43.5k
1 vote
2 answers
2k views

Magento 2 : Creating widget using install script

I have a custom module for megamenu. I want to create some widgets predefined for the module when the customer installs this module. I have added the below script for creating the widget(widget type: ...
user avatar
  • 1,355
1 vote
3 answers
4k views

Magento 2 - InstallData.php does not run again after first time

I have created my custom module to add more attributes for customers. The InstallData.php worked perfectly for the first time and added all the attributes I wanted. However, I need to add more ...
user avatar
0 votes
2 answers
3k views

How to manage InstallData.php File in magento 2

How can I manage my InstallData.php file when I want to create multiple attribute for customer and product? Here, in my InstallData file I have create an attribute for the product. namespace ...
user avatar
3 votes
1 answer
5k views

Magento 2 : Create product attribute with select box install script

I'm having issues while creating product attribute with Install Data.php with my custom module. Attribute is crated also with options what i have defined in source but i am facing weird check below ...
user avatar
  • 3,654
0 votes
1 answer
431 views

How to do db table collate change using update script?

I am trying to make a collate change (DEFAULT CHARSET=utf8 COLLATE utf8_general_ci) to db but not sure how? (magento1.9) <?php $installer = $this; $installer->startSetup(); $installer->...
user avatar
  • 175
0 votes
1 answer
1k views

Magento 2 Install schema

When I am adding column of TYPE_DECIMAL like this ->addColumn( 'credit', Table::TYPE_DECIMAL, null, ['nullable' => false, 'default' => '0.00', 'length' => '10,2'], '...
user avatar
0 votes
1 answer
227 views

Add new form code for customer_form_attribute in Magento 1.9

I added new customer fields (attributes) by installer in my Magento extension. I want group this fields and show in separate tabs on customer edit page. I can make it in installer with this code ...
user avatar
  • 101
3 votes
2 answers
3k views

Magento 2: Run a uninstall script when module is uninstalled via command line?

I am creating a module and I am progressing it. I am new to Magento 2 so there are a lot of things that I am not yet familiar too. As a module creator, I am curious how to run an uninstall script when ...
user avatar
  • 1,019
1 vote
2 answers
936 views

Magento 2.2.2 - InstallSchema.php - update multiple tables

While developing a new extension, I'm trying to update two tables at installation time by using Setup\InstallSchema.php. The tables are "admin_user" and "customer_entity", and I basically need the ...
user avatar
2 votes
1 answer
238 views

Install and data-install script with different versions?

I have a custom module with several install and upgrade scripts under the sql directory, that create and alter my sql table. When Magento runs the scripts it updates both version and data_version ...
user avatar
1 vote
0 answers
23 views

After Magento 1 security upgrade, the install scripts are not working

After a security version upgrade to version (1.14.3.6) Enterprise all my update scripts don't work. Whether it's inserting, updating... nothing in the install scripts executes. Anyone with a similar ...
user avatar
  • 11
0 votes
0 answers
25 views

Magento2 model save() method connected to db table structure in the install schema

I have a basic model - MyModel. The install schema for the table that the model is working with is $setup ->getConnection() ->newTable('my_table') ->addColumn( 'id', Table::...
user avatar
0 votes
1 answer
191 views

Table create script not working Magento2

So I followed this tutorial on how to create a module with a table setup script: http://www.mage-world.com/blog/create-a-module-with-custom-database-table-in-magento-2.html I took out a few things ...
user avatar
  • 121
0 votes
1 answer
29 views

How to unselect modules in CLI installation

When installing through the web UI wizard, you're given the option to not install certain modules (Customize your store -> Advanced Modules Configurations). Can the same be done with the CLI ...
user avatar
7 votes
3 answers
1k views

Magento2 What's the point of having both InstallSchema and UpgradeSchema

If UpgradeSchema/UpgradeData are executed when installing and upgrading a module what's the point of having InstallSchema/InstallData (besides just having a well-named file that is only executed once)....
user avatar
  • 727
6 votes
5 answers
15k views

Magento 2 How to add foreign key in update schema

I try to add foreign key constrains for Magento 2 existing tables. I have UpdateSchema script but it's not working. <?php namespace Retailers\Customer\Setup; use Magento\Framework\Setup\...
user avatar