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

Specify SiteAccess for translations data migrations #2247

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 7 additions & 1 deletion docs/content_management/data_migration/exporting_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ or in [a custom folder that you configure](managing_migrations.md#migration-fold
You can later use this file to import the data.

``` bash
php bin/console ibexa:migrations:generate --type=content --mode=create
php bin/console ibexa:migrations:generate --type=content --mode=create --siteaccess=admin
```

This generates a file containing all Content items.
Expand Down Expand Up @@ -134,6 +134,12 @@ Note that you should test your migrations. See [Importing data](importing_data.m

Migration command can be executed with database rollback at the end with the `--dry-run` option.

!!! caution

`--siteaccess` option usage can be relevant on multi-languages repository.
You must export with the SiteAccess supporting all the languages, or migration skips translations in non-supported languages.
It is recommended to use the SiteAccess of the Back Office of the targeted repository.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

## type

The mandatory `--type` option defines the type of Repository data to export.
Expand Down
7 changes: 6 additions & 1 deletion docs/content_management/data_migration/importing_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ and specify the file name within this folder as parameter.
If you don't specify the file, all files within this directory are used.

``` bash
php bin/console ibexa:migrations:migrate --file=my_data_export.yaml
php bin/console ibexa:migrations:migrate --file=my_data_export.yaml --siteaccess=admin
```

Migrations store execution metadata in the `ibexa_migrations` database table.
This allows incremental upgrades:
the `ibexa:migrations:migrate` command ignores files that it had previously executed.

Notice the `--siteaccess` option usage.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
This can be important, especially when several languages are used.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
You must import with the SiteAccess supporting all the languages, or migration skips translations in non-supported languages.
It's recommended to use the SiteAccess of the Back Office of the targeted repository.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

## Migration step

A data migration step is a single operation in data migration process
Expand Down