Important
You are browsing upcoming documentation for version 7.0 of OroCommerce, scheduled for release in 2026. Read the documentation for the latest LTS version to get up-to-date information.
See our Release Process documentation for more information on the currently supported and upcoming releases.
CLI Commands (AddressBundle)
oro:countries:regions:actualize
The oro:countries:regions:actualize command actualizes countries and regions data from an external provider.
php bin/console oro:countries:regions:actualize <filepath> <option>
The filepath argument is required and specifies the application path where updated data files should be saved (e.g., var/data).
You must select exactly one of the following options:
The --update-full-data option downloads the external file and uses it to fully update countries and regions data, replacing old codes and names:
php bin/console oro:countries:regions:actualize var/data --update-full-data
The --add-new-data option adds only new countries and regions that are absent in the local file:
php bin/console oro:countries:regions:actualize var/data --add-new-data
The --remove-old-data option removes countries and regions that exist only in the local file but are absent in the external file:
php bin/console oro:countries:regions:actualize var/data --remove-old-data
The command creates two files:
countries.yml- contains country and region codes (ISO 3166-1 and ISO 3166-2)entities.en.yml- contains translations for country and region names
oro:countries:regions:update-db
The oro:countries:regions:update-db command updates countries and regions data in the database based on the actualized YAML files (countries.yml and entities.en.yml).
This command is typically used after running oro:countries:regions:actualize to apply the changes to the database.
php bin/console oro:countries:regions:update-db [options]
Data Sources
By default, the command reads data from the following files:
Translation file:
@OroAddressBundle/Resources/translations/entities.en.yml- contains country and region name translationsCountries file:
@OroAddressBundle/Migrations/Data/ORM/data/countries.yml- contains country and region codes (ISO2, ISO3, combined codes)
You can specify custom file paths using options:
php bin/console oro:countries:regions:update-db --translation-file=/path/to/entities.en.yml --countries-file=/path/to/countries.yml
Options
The --force option executes the actual database updates. Without this option, the command runs in dry-run mode and only displays the SQL queries that would be executed:
php bin/console oro:countries:regions:update-db --force
The --translation-file option specifies a custom path to the translation file:
php bin/console oro:countries:regions:update-db --translation-file=var/data/entities.en.yml --force
The --countries-file option specifies a custom path to the countries/regions data file:
php bin/console oro:countries:regions:update-db --countries-file=var/data/countries.yml --force
Database Tables Affected
The command modifies the following database tables:
oro_dictionary_country- stores country data (ISO2 code, ISO3 code, name)oro_dictionary_region- stores region data (combined code, country code, code, name)oro_translation_key- stores translation keys for new countries/regionsoro_translation- stores translation values
Operations Performed
The command performs the following operations:
Adding New Data
Compares countries from the YAML file with existing database records
Inserts new countries into
oro_dictionary_countrytableInserts new regions into
oro_dictionary_regiontableCreates translation keys in
oro_translation_keytable for new entriesAdds translations to
oro_translationtable
Deleting Old Data (Soft Delete)
The command uses soft delete mechanism - records are not physically removed from the database. Instead, the deleted flag is set to true:
Countries that exist in the database but are absent in the YAML file are marked as deleted (
deleted = true)Regions that exist in the database but are absent in the YAML file are marked as deleted (
deleted = true)
Warning
Soft-deleted countries and regions remain in the database but are excluded from queries that filter by deleted = false.
Updating Existing Translations
Compares country names in the database with names in the translation file
Updates
oro_dictionary_country.nameif the name has changedUpdates corresponding
oro_translationrecord for the countryPerforms the same operations for regions in
oro_dictionary_regiontable
Transaction Handling
All database operations are wrapped in a transaction:
With
--forceoption: the transaction is committed, and changes are persistedWithout
--forceoption: the transaction is rolled back, no changes are saved (dry-run mode)
Example Workflow
A typical workflow for updating countries and regions data:
First, actualize the YAML files from the external source:
php bin/console oro:countries:regions:actualize var/data --update-full-data
Review the generated files in
var/data/:countries.ymlentities.en.yml
Preview the SQL queries that will be executed (dry-run):
php bin/console oro:countries:regions:update-db --countries-file=var/data/countries.yml --translation-file=var/data/entities.en.yml
Apply the changes to the database:
php bin/console oro:countries:regions:update-db --countries-file=var/data/countries.yml --translation-file=var/data/entities.en.yml --force