Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 2.49 KB

xml-migration-epi.md

File metadata and controls

49 lines (31 loc) · 2.49 KB

Xml Languge FIle Migration Tool

Import Language Xml Files

This is a natural situation when adding DbLocalizationProvider to the project - there already will be Xml language files present.

Even after DbLocalizationProvider library is added - old Xml language files will continue to work. However - if you would like to get rid of language files completely - you will need to migrate them to the database.

Migration may happen in 2 ways:

  • via SQL script generated by migration tool
  • sometimes direct access (via SqlConnection object) may not be applicable. That's why it's possible to extract all Xml language file resources and later import them into database via Administration UI (AdminUI).

Migration with SQL script

Migration via SQL script is pretty simple. First of all you need to install DbLocalizationProvider.MigrationTool package. Then you can execute .exe file inside package tools/ folder.

> DbLocalizationProvider.MigrationTool.exe -s="{path-to-project}" -e -i

Description of the configuration parameters:

Option Description
-s specifies Source directory for the project (your web root)
-t specifies Target directory for operation (where to write output files)
-resourceDirectory Xml language resource directory (relative to source directory -s), default = Resources\LanguageFiles
-o Generate update statements for existing resources. Not effective if using JSON format
-e Export all resources from language Xml files into SQL format file (resulting file localization-resource-translations.sql by default is located in the same folder specified by -s)
-f Export localization resources from database. Either EPiServerDB connection string name will be used or value specified by -c parameter
-i Import resources from exported file into directly database (using connection string named EPiServerDB)
-c Set connectionstring to be used for resource import. This is for lazy (when reading from web.config file or app.config is way too simple)
-x Export localization resources only from XML files
-j Use JSON file format
-d Ignore duplicate keys (take first found)

Migration via JSON file

Using JSON format export file is similar as with SQL script file, you just need to provide switch to use JSON file (import from AdminUI is supported only with JSON format files).

> DbLocalizationProvider.MigrationTool.exe -s="{path-to-project}" -e --json