Migrating a Knowledge Base between GeneXus Server instances

Official Content

This document explains how to migrate a Knowledge Base from one GeneXus Server instance to another.

Note: before migrating a Knowledge Base:

Step by step

1) Commit all objects that are pending for commit.

2) Make a freeze version "BeforeV15" in GeneXus Server Evolution 3 instance.

3) If needed, install a new GeneXus Server instance following the steps described in the GeneXus Server 15 Installation Manual, and set up permissions in this new GeneXus Server 15 instance.

4) Export the Knowledge Base from the original Server instance using the GeneXus Server Storage Migrator Utility (GXSSM). As a result, a .zip file including all the Knowledge Base information will be generated.

5) Import the generated file to the destination Server using the GeneXus Server Storage Migrator Utility. The operation may be performed in a new GeneXus Server instance or the same instance using a different KB alias to duplicate the Knowledge Base.

6) Make a freeze version "AfterEvo3" in GeneXus Server 15 instance.

7) Checkout of the migrated Knowledge Base in GeneXus Server 15 instance from an IDE GeneXus 15.

Note: Steps 2 and 6 are optional but they are highly recommended as "good practices", as they help you to know what changes have been committed to any of the 2 instances after migration.

Usage example

Let's consider a Knowledge Base with SampleKB as KBalias.

After getting to the GXSSM.exe file (under C:<GeneXus Server installation folder>\VDir\Bin) execute it using command line:

C:<GeneXus Server installation folder>\VDir\Bin\gxssm.exe /e /kb:"SampleKB" /out:"c:\temp"

A SampleKB.zip file will be created in the C:\temp folder.

To import the SampleKB.zip file in the new GeneXus Server instance execute:

C:<GeneXus Server installation folder>\VDir\Bin\gxssm.exe /i:"c:\temp\SampleKB.zip" /kb:"MigratedSampleKB" /ignoregam:true

Note: the SQL Server instance associated with the GeneXus Server instance must be the same or higher than the original GeneXus Server instance where it was exported. A downgrade path is not supported (e.g. export a Knowledge Base using SQL Server 2008 and import it in SQL Server lower version such as 2005). Otherwise, the following error will occur:

=== Section ImportKB started ===
Extracting file to temp folder 'C:\Users\GeneXusUser\AppData\Local\Temp\ATT201202241801'
Loading GXserver defaults...
Renaming database files...
Attaching database...
Error:Error importing data
Error:The database 'GXS_SampleKB' cannot be opened because it is version 655. This server supports version 612 and earlier.
A downgrade path is not supported.
Could not open new database 'GXS_SampleKB'.
CREATE DATABASE is aborted.
Error:   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand
      cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Artech.Udm.Framework.SQL.DataConnection.Attach(KBConnectionInfo info) in e:\Development\GxXEv2\Udm\Layers\Data\SQL\KBSQLConnection.cs:line 37
   at GenexusServer.StorageMigrator.Reorgs.Import.ExecuteOperation() in e:\Development\GxXEv2\Common\Tools\GXserverMigrator\Reorgs\Import.cs:line 99
=== Section Import KB ended with errors ===

Troubleshooting

Exporting GAM Data

The following error may occur during the export process

=== Section Exporting GAM data ended successfully ===
Warning:Could not find a part of the path 'C:\GeneXusServer\VDir\Bin\jsons\KnowledgeBaseName.gam.zip'.

Delete the folder content and retry the operation.

Log File Configuration

The following error could occur during an import operation; you can dismiss the error:

Starting BL...
log4net:ERROR [RollingFileAppender] 
Unable to acquire lock on file C:\GeneXusServer\VDir\Bin\gxssm.log. 
The process cannot access the file 'C:\GeneXusServer\VDir\Bin\?gxssm.log'
because it is being used by another process.

by using the ExitOnError flag.

The following error may occur when using the /ExitOnError flag, if the GeneXus Server instance is not secure

Input:/e /kb:"sandboxKB" /out:"c:\temp" /ExitOnError
Warning:GXserver is not secure. Ignoring GAM data
Error:Error exporting data
Error:GAM Exportation Failed
Error:   at GenexusServer.StorageMigrator.Reorgs.Export.ExportKB(GXS_KBCatalog kb)
  at GenexusServer.StorageMigrator.Reorgs.Export.ExecuteOperation()

Remove the /ExitOnError flag or change it to /Ignoregam: true


Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.