From d137b1fbf156a14cd75b0cfe38502d0bc6bbc0d2 Mon Sep 17 00:00:00 2001 From: Valdis Iljuconoks Date: Tue, 1 Mar 2016 16:43:49 +0200 Subject: [PATCH] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 4c14a0af..181ac14e 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,43 @@ New localization provider needs to be "registered" and added to the list of the **NB!** If you do have extracted `` section into separate file (usually `episerver.framework.config`), please clean-up web.config after NuGet package installation and move content of the `` section to that separate physical file. +## 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 +``` + +Explanation of switches used: + +* `-s` - specifies **s**ource directory for the project (your web root) +* `-e` - asks migration tool to **e**xport 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`) +* `-i` - asks migration tool to **i**mport resources from exported file into directly database (using connection string named `"EPiServerDB"`) + +### 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 +``` + + ## DbLocalizationProvider Features All resources in DbLocalizationProvider system are divided into 2 groups: