This document explains how to migrate a Knowledge Base from one GeneXus Server instance to another.
Note: before migrating a Knowledge Base:
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 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.
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...
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 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 ===
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.
The following error could occur during an import operation; you can dismiss the error:
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.
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)
Remove the /ExitOnError flag or change it to /Ignoregam: true
The following error could occur when migrating a KB between servers:
========== Receive changes started ==========
Contacting GeneXus Server at 'http://servername/instancename'...
GeneXus Server: Update since MM/DD/YYYY HH:MM:SS PM requested by gxtechnical\username on version KBVersionName of 'KBNname'
error: GeneXus Server: srv005:The Client Knowledge Base is not linked to this Server Knowledge Base: 'KBVersionName'
Failed: Receive changes
Make sure to use the GeneXus Server Storage Migrator Utility to move a GXserver KB between instances. If you moved it by doing a
- create KB from server
- disconnect from that client KB
- send the local working KB to another server
then that KB server on the new server is a different KB server, and any other client KBs cannot change to use this new GXserver instance; you need to do a new create KB from server.