Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added instructions for upgrading OSS from 3.3.33 to 4.6.16 #2641

Open
wants to merge 1 commit into
base: 4.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/update_and_migration/from_3.3/update_from_3.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,24 @@ Run the following scripts:
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-3.3.33-to-3.3.34.sql
```

### Ibexa Open Source

If you have no access to [[= product_name =]]'s `ibexa/installer` package, apply the following database upgrade script:

=== "MySQL"
``` sql
ALTER TABLE `ezcontentobject_attribute` ADD INDEX `ezcontentobject_attribute_co_id_ver` (`contentobject_id`,`version`);
ALTER TABLE `ezurl_object_link` ADD INDEX `ezurl_ol_coa_id_cav` (`contentobject_attribute_id`,`contentobject_attribute_version`);
ALTER TABLE `ezcontentobject_link` ADD INDEX `ezco_link_cca_id` (`contentclassattribute_id`);
```

=== "PostgreSQL"
``` sql
CREATE INDEX "ezco_link_cca_id" O##N "ezcontentobject_link" ("contentclassattribute_id");
CREATE INDEX "ezcontentobject_attribute_co_id_ver" ON "ezcontentobject_attribute" ("contentobject_id", "version");
CREATE INDEX "ezurl_ol_coa_id_cav" ON "ezurl_object_link" ("contentobject_attribute_id", "contentobject_attribute_version");
```

### v3.3.40

No additional steps needed.
Expand Down
64 changes: 63 additions & 1 deletion docs/update_and_migration/from_4.1/update_from_4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,69 @@ Apply the following database update scripts:

#### Ibexa Open Source

If you have no access to [[= product_name =]]'s `ibexa/installer` package, database upgrade isn't necessary.
If you have no access to [[= product_name =]]'s `ibexa/installer` package, apply the following database upgrade script:

=== "MySQL"
``` sql
CREATE TABLE IF NOT EXISTS ibexa_user_invitations
(
id int auto_increment primary key,
email varchar(255) not null,
site_access_name varchar(255) not null,
hash varchar(255) not null,
creation_date int not null,
used tinyint(1) null,
constraint ibexa_user_invitations_email_uindex
unique (email(191)),
constraint ibexa_user_invitations_hash_uindex
unique (hash(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS ibexa_user_invitations_assignments
(
id int auto_increment primary key,
invitation_id int not null,
user_group_id int null,
role_id int null,
limitation_type varchar(255) null,
limitation_value varchar(255) null,
constraint ibexa_user_invitations_assignments_ibexa_user_invitations_id_fk
foreign key (invitation_id) references ibexa_user_invitations (id)
on update cascade on delete cascade
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
```

=== "PostgreSQL"
``` sql
CREATE TABLE IF NOT EXISTS ibexa_user_invitations
(
id SERIAL PRIMARY KEY,
email VARCHAR(255) NOT NULL,
site_access_name VARCHAR(255) NOT NULL,
hash VARCHAR(255) NOT NULL,
creation_date INTEGER NOT NULL,
used BOOLEAN DEFAULT false NOT NULL
);

CREATE UNIQUE INDEX IF NOT EXISTS ibexa_user_invitations_email_uindex
ON ibexa_user_invitations (email);

CREATE UNIQUE INDEX IF NOT EXISTS ibexa_user_invitations_hash_uindex
ON ibexa_user_invitations (hash);

CREATE TABLE IF NOT EXISTS ibexa_user_invitations_assignments
(
id SERIAL PRIMARY KEY,
invitation_id INTEGER NOT NULL,
user_group_id INTEGER NULL,
role_id INTEGER NULL,
limitation_type VARCHAR(255) NULL,
limitation_value VARCHAR(255) NULL,
CONSTRAINT ibexa_content_customer_group_attribute_fk
FOREIGN KEY (invitation_id) REFERENCES ibexa_user_invitations (id)
ON UPDATE CASCADE ON DELETE CASCADE
);
```

## Ensure password safety

Expand Down
69 changes: 51 additions & 18 deletions docs/update_and_migration/from_4.5/update_from_4.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ Run the following scripts:
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-4.5.1-to-4.5.2.sql
```

##### Ibexa Open Source

If you have no access to [[= product_name =]]'s `ibexa/installer` package, apply the following database upgrade script:

=== "MySQL"
``` sql
ALTER TABLE `ezcontentobject_link` ADD INDEX `ezco_link_cca_id` (`contentclassattribute_id`);
ALTER TABLE `ezcontentclass_attribute` ADD INDEX `ezcontentclass_attr_dts` (`data_type_string`);
ALTER TABLE `ezurl_object_link` ADD INDEX `ezurl_ol_coa_id_cav` (`contentobject_attribute_id`,`contentobject_attribute_version`);
ALTER TABLE `ezcontentobject_attribute` ADD INDEX `ezcontentobject_attribute_co_id_ver` (`contentobject_id`,`version`);
```

=== "PostgreSQL"
``` sql
CREATE INDEX "ezco_link_cca_id" ON "ezcontentobject_link" ("contentclassattribute_id");
CREATE INDEX "ezcontentclass_attr_dts" ON "ezcontentclass_attribute" ("data_type_string");
CREATE INDEX "ezcontentobject_attribute_co_id_ver" ON "ezcontentobject_attribute" ("contentobject_id", "version");
CREATE INDEX "ezurl_ol_coa_id_cav" ON "ezurl_object_link" ("contentobject_attribute_id", "contentobject_attribute_version");
```


### v4.5.3

#### Database update [[% include 'snippets/experience_badge.md' %]] [[% include 'snippets/commerce_badge.md' %]]
Expand Down Expand Up @@ -193,6 +214,36 @@ Apply the following database update scripts:
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-4.5.latest-to-4.6.0.sql
```

### Ibexa Open Source

If you have no access to [[= product_name =]]'s `ibexa/installer` package, apply the following database upgrade script:

=== "MySQL"
``` sql
ALTER TABLE `ibexa_token`
ADD COLUMN `revoked` BOOLEAN NOT NULL DEFAULT false;

-- Rewrites max file size values from data_int1 to data_float1 column and stores size unit
UPDATE ezcontentclass_attribute
SET data_float1 = CAST(data_int1 AS DOUBLE), data_int1 = NULL, data_text1 = 'MB'
WHERE data_type_string = 'ezimage';

UPDATE ezcontentclass_attribute SET is_searchable = 1 WHERE data_type_string = 'ezimage' AND contentclass_id = (SELECT id FROM ezcontentclass WHERE identifier = 'image');
```

=== "PostgreSQL"
``` sql
ALTER TABLE "ibexa_token"
ADD "revoked" BOOLEAN DEFAULT false NOT NULL;

-- Rewrites max file size values from data_int1 to data_float1 column and stores size unit
UPDATE ezcontentclass_attribute
SET data_float1 = CAST(data_int1 AS DOUBLE PRECISION), data_int1 = NULL, data_text1 = 'MB'
WHERE data_type_string = 'ezimage';

UPDATE ezcontentclass_attribute SET is_searchable = 1 WHERE data_type_string = 'ezimage' AND contentclass_id = (SELECT id FROM ezcontentclass WHERE identifier = 'image');
```

### Update [[= product_name_com =]] database [[% include 'snippets/commerce_badge.md' %]]

For [[= product_name_com =]] installations, you also need to run the following command line:
Expand Down Expand Up @@ -277,24 +328,6 @@ php bin/console ibexa:migrations:import vendor/ibexa/order-management/src/bundle
php bin/console ibexa:migrations:migrate --file=2023_11_20_14_33_order_dashboard_structure.yaml
```

### Ibexa Open Source

If you don't have access to [[= product_name =]]'s `ibexa/installer` package and cannot apply the scripts from `vendor/ibexa/installer` directory, apply the following database update instead:

=== "MySQL"

``` sql
ALTER TABLE `ibexa_token`
ADD COLUMN `revoked` BOOLEAN NOT NULL DEFAULT false;
```

=== "PostgreSQL"

``` sql
ALTER TABLE "ibexa_token"
ADD "revoked" BOOLEAN DEFAULT false NOT NULL;
```

## Revisit configuration

### Revisit mandatory configuration
Expand Down
41 changes: 41 additions & 0 deletions docs/update_and_migration/from_4.6/update_from_4.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,47 @@ Run the following scripts:
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-4.6.3-to-4.6.4.sql
```

##### Ibexa Open Source

If you have no access to [[= product_name =]]'s `ibexa/installer` package, apply the following database upgrade script:

=== "MySQL"
``` sql
-- IBX-6592: The state/assign policy shouldn't utilize neither Location nor Subtree limitations
DELETE l
FROM `ezpolicy_limitation` l
INNER JOIN `ezpolicy` p ON p.id = l.policy_id
WHERE p.function_name = 'assign'
AND p.module_name = 'state'
AND l.identifier IN ('Node', 'Subtree');

DELETE lv
FROM `ezpolicy_limitation_value` lv
LEFT JOIN `ezpolicy_limitation` ON `ezpolicy_limitation`.id = lv.limitation_id
WHERE `ezpolicy_limitation`.id IS NULL;
```

=== "PostgreSQL"
``` sql
-- IBX-6592: The state/assign policy shouldn't utilize neither Location nor Subtree limitations
DELETE
FROM "ezpolicy_limitation"
WHERE "ezpolicy_limitation".id IN
(SELECT "ezpolicy_limitation".id
FROM "ezpolicy_limitation"
INNER JOIN "ezpolicy" ON "ezpolicy".id = "ezpolicy_limitation".policy_id
WHERE "ezpolicy".function_name = 'assign'
AND "ezpolicy".module_name = 'state'
AND "ezpolicy_limitation".identifier IN ('Node', 'Subtree'));
DELETE
FROM "ezpolicy_limitation_value"
WHERE "ezpolicy_limitation_value".id IN
(SELECT "ezpolicy_limitation_value".id
FROM "ezpolicy_limitation_value"
LEFT JOIN "ezpolicy_limitation" ON "ezpolicy_limitation".id = "ezpolicy_limitation_value".limitation_id
WHERE "ezpolicy_limitation".id IS NULL);
```

## v4.6.8

To avoid deprecations when updating from an older PHP version to PHP 8.2 or 8.3, run the following commands:
Expand Down