This topic explains how use a script to migrate data from Tark3 to Tark4. The script is available for download on a Tera forum. Download all the attachments and then extract them in order they've been posted, in the same folder, overwriting existing files - in that way, after extracted all of them, you will have the most updated version of all files.
The export/import process uses these files:
•TarkToTark4.ini: configuration file to set the script export/import process. You need to customize it.
•TarkToTark4.vbs: export data from Tark database;
•tidy.conf: configuration file used from tydy.exe. You don't have to modify it!
•tidy.exe: utility, called from the script, used to normalize the text from old tark db that do not use xml format.
•wf_Import_Tark.xml: workflow used by srv4 to import the xml objects generated by the script.
Sections in TarkToTark4.ini
[folderRef] is the folder under it create the structure YEAR MONTH DAY
[creatorRef] The user used to create the element in tark4 database
[Servername] SQL Server Name
[Databasename] Database name
[User] Sql user (usually "sa")
[Password] The "sa" password
[Xmlpath] The path in which create the structure and the extracted xml
[Nfiles] The max number of xml saved in every folder (1)
[Local_Tarkdata] The tarkdata path used in the database (2)
[UNC_Tarkdata] the tarkdata unc path (3)
[PublicationID] This is the publication id to extract (Default: set to ALL). You can specify ALL, or 381, or 381, 382, 383.
[DataRange] Publication date range (in sql format YYYYMMDD) to extract. Example 20100101 20100105 (Default: set to ALL). You can also use variable today.
[BIN_PATH] This is Tark4 binary path used to import structure and datas using srv4 (usually C:\TERA\GN4\BIN)
[CHECKIMGFAILED] If set to TRUE, the script will exit if an image is missing from tarkdata.
[CHECKINGIMG] If set to TRUE the script will check the images in the tarkdata. Set correctly Local_Tarkdata and UNC_Tarkdata for path replacement (4)
[SKIPSTRUCTURE] If set to TRUE skip the structure import process in tark4 (5)
[ADDITIONALTABLES] If set to TRUE it will import additional table (Copyrights, Publications, Sections, Zones) in the Tark4 database
[EXECUTEBULK] If set to TRUE execute the bulkinsert at the end of export process
[TXTNAME] rule (in SQL format) to compose the text name in tark4 (6)
[IMGNAME] rule (in SQL format) to compose the images name in tark4 (6)
[DOCNAME] rule (in SQL format) to compose the pages name in tark4 (6)
[MMNAME] rule (in SQL format) to compose the multimedias name in tark4 (6)
[PKGNAME] rule (in SQL format) to compose the packages name in tark4 (6)
[WorkFlow] workflow used in bulkinsert by srv4
Notes for above
(1) This is the max number of files for every kind of element. So you have to add Text + Images + Pages(+Thumbnail) + Multimedias + Packages <= 65535 IS THE LIMIT FOR WINDOWS. Default 10000 * 6 kind of element = 60000
(2) This is the root of the fields "path" in the imgtable. You can also specify more paths, delimited by semicolon, e.g.T:\archive;T:\tarkdata
(3) This is used to replace the path in the images object. Set it correctly to check the tarkdata images and import in the Tark4 database. If the database is already UNC set [Local_Tarkdata] and [UNC_Tarkdata] with the same path. You can also specify \\MYSERVER\archive;\\MYSERVER\tarkdata.
(4) The missing images will be listed in the file Missing_image.log created in the script path
(5) If you do the import/export process in more steps (from PublicationId and/or DataRange) you need to import the structure only the first time.
(6) It is needed to give a unique name to the element to import in the Tark4 because the reference will be done by keyval
You can use today variable in the data range in the ini file to use the script in a scheduled task. It is possible to do combination of fixed data and variable. It is also possible to add or remove day from the today variable:
Examples
[DataRange]
20100101 today
[DataRange]
20100101 today-1
[DataRange]
today-5 today+1
[DataRange]
today-30 20101019
Sample TarkToTark4.ini
[folderRef]
obj8
[creatorRef]
obj4
[Servername]
omega
[Databasename]
TARKNEEG
[User]
sa
[Password]
xxxx
[Xmlpath]
C:\TEST
[Nfiles]
10000
[Local_Tarkdata]
\\192.168.1.20\tarkdata\
[UNC_Tarkdata]
\\OMEGA\tarkdata\
[PublicationID]
ALL
[DataRange]
19981216 19981216
[BIN_PATH]
C:\TERA\GNPORTAL\BIN
[CHECKIMGFAILED]
TRUE
[CHECKINGIMG]
TRUE
[SKIPSTRUCTURE]
FALSE
[ADDITIONALTABLES]
TRUE
[EXECUTEBULK]
TRUE
[TXTNAME]
'TARKTXT' + cast(TxtTable.Id as varchar) + TxtTable.name as Tark4Name
[IMGNAME]
'TARKIMG' + cast(ImgTable.Id as varchar) + ImgTable.name as Tark4Name
[DOCNAME]
'TARKDOC' + cast(PageTable.Id as varchar) + PageTable.name as Tark4Name
[MMNAME]
'TARKMM' + cast(MMFilesTable.Id as varchar) + MMFilesTable.name as Tark4Name
[PKGNAME]
'TARKPKG' + cast(GroupTable.Id as varchar) + GroupTable.name as Tark4Name
[WorkFlow]
Import_Tark
To run the script open a command prompt and run:
cscript TarkToTark4.vbs
Notes related to publication and title
If you migrated Tark to Tark4 using an older version of TarkToTark4 script, you may end up with some publications created but without related titles, and if you try to add a title in GN4, you will have an error.
This problem does not appear with recent versions of the TarkToTark4 script where the Title is created together with the Publication when using a GN4 configuration.
The way to fix is manual and explained below.
Before you start, make a fresh database backup and prevent all changes to the database until done with the below procedure. This because the query that elevates publication to title is potentially dangerous and can leave the database in an unusable state. Should this happen, reload the backup and then retry.
Make sure that the publication has the definitive name and then do the following query:
SELECT * FROM s_PublicationTable
and locate the ID for publication you want to elevate to a title. Let's call this ID XXXX.
Locate the JustScope ID to be assigned to the new title by looking into the editorial Tab in the INT interface:
Let's call this JustScope ID YYYY.
Now elevate the object type from publication to title by running the below query:
update s_ObjectTable set gn_ObjectTypeId=(select gn_Id from gn_ObjectTypeTable where gn_Name='title') where s_id=XXXX
and create the entry in the TitleTable:
insert s_TitleTable(s_id, s_justScopeRef) values (XXXX,YYYY)
At this point there will be a title named as the publication, and you will be able to use it in GN4.