> ## Documentation Index
> Fetch the complete documentation index at: https://support.lilt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Syncing Language Data

Language data (languages, locales, and language-locale pairs) is synced
automatically by the `front-init` container on startup. The
`sync-language-data` admin-cli command can be run manually in production to
retry or debug syncing language data in case of any issues or missing language
pairs.

## Applying Changes

1. Preview changes with a dry run (no database modifications):

`yarn admin-cli sync-language-data -d`

2. Run the sync:

`yarn admin-cli sync-language-data`

The command will prompt for confirmation before making changes. The current git commit hash is recorded as the migration identifier for traceability.

## Rolling Back Changes

If you need to undo a sync, use the `--undo` / `-u` flag. This is a two-step process:

1. On the commit that was synced, run undo to delete the pairs it inserted:\
   `yarn admin-cli sync-language-data --undo`

2. Check out the previous commit and re-run the sync to restore any rows that were updated:\
   `git checkout <previous-commit>`\
   `yarn admin-cli sync-language-data`

<Info>
  The undo only removes `LanguageLocalePairs` rows matching the commit's
  migration ID. It does not revert updates to existing rows (such as changes to
  providers or MT settings). Re-running the sync from the previous commit
  handles that.
</Info>
