Class SY_Migration

Inherits

SY_Password

Properties

LOCAL archFRAMEWORK=4  

[Numeric] Constant to indicate application architecture is framework.

LOCAL archLEGACY=3  
[Numeric] Constant to indicate application architecture is legacy.
LOCAL archNOTHING=0  
[Numeric]Constant to indicate application architecture is unknown.
LOCAL migPVX2PVX=1  
[Numeric] PVX to PVX Migration Type
LOCAL migPVX2SQL=2  
[Numeric] PVX to SQL Migration Type
LOCAL migSQL2SQL=3  
[Numeric] SQL to SQL Migration Type
LOCAL cPayrollAppName$  
[String] Application name for Payroll 2.0
PROPERTY InstallationHandle   * Read Only *
[property, object handle] Handle to SY_Installation object
PROPERTY SQLHandle   * Read Only *
[property, object handle] Handle to SY_MigrationSQL object

Methods

Global worktable deletion occurs if companyCode$ not specified.

FUNCTION ActiveUsers()  

Returns the number of users in Sage 100 by reading SY_Console.

Returns [Numeric]
ValueDescription
-1 If current user is the only active user.
activeUsers Number of users if current user is not the only active user
FUNCTION CheckForMissingModules(sourcePath$, resultMessage$)  

Check for modules that are in the source installation but not in the target installation. If there are missing modules then the migration will be aborted. There is a separate message for C/U because it was available in some versions of MAS 90 before the release of EES.

ParameterDescription
sourcePath$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
resultMessage$ [output, string] Message text if there is an error or there are missing modules
Returns [Numeric]
ValueDescription
-1 Error condition; resultMessage$ will contain error info
0 All modules from source are in target installation; resultMessage$ will be null
1 Missing module(s) discovered; resultMessage$ will contain list of module names
2 C/U module was found in the source; resultMessage$ will contain message text (obsolete as of 4.50)
3 Missing applets discovered; resultMessage will contain list of applet names
FUNCTION CheckForModulesToInstall(sourcePath$, resultMessage$)  

Check for modules that must be installed or reinstalled in the target installation after migrating. These are modules that have installation programs separate from our main InstallShield install, such as Development Studio or vertical modules from MDs. Since other installations would not have laid down the merge files for us to use when reinstalling after copying files they must be manually reinstalled. Other modules may have been in the source so the user will need to install them to synchronize the programs with the migrated files.

ParameterDescription
sourcePath$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
resultMessage$ [output, string] Message text if there is an error or there are modules that need to be installed.
Returns [Numeric]
ValueDescription
-1 Error condition; resultMessage$ will contain error info
0 There are no modules in the target that need to be installed; resultMessage$ will be null
1 Discovered modules that need installation; resultMessage$ will contain list of module names
FUNCTION CheckForUsers()  
FUNCTION CheckForUsers(sourcePath$)  

Determine if we need to prompt for a user logon or not. If no users are set up we can just logon without a user name and password. However, we need to send this back to the Migration Wizard which controls the UI for this process.

ParameterDescription
sourcePath$ {optional}[input, string] Path to the source installation. If not passed in, assume framework and use SY_System.M4T to check for security enabled.
Returns [Boolean]
ValueDescription
0 retFAILURE Security is setup and we need a user name and password
1 retSUCCESS Security is not setup so we can logon without a user and password
FUNCTION CheckSourceForEES(eeIsRegistered, cuLevel100, eeLevel100)  

Check if the source installation is an EES installation by checking the registration for the EE Module.

ParameterDescription
eeIsRegistered [output, boolean] Set if EE Module exists in list of registered modules from SY_System.M4T
cuLevel100 [output, numeric] Module level for C/U Module
eeLevel100 [output, numeric] Module level for E/E Module
Returns [Numeric]
ValueDescription
1 retSUCCESS Always returns success
FUNCTION CheckSourceForPADSS(sourcePath$, compCode$, resultMessage$)  

This check is primarily for the 4.40 release. PA-DSS was implemented in versions 4.30.0.x and 4.40.0.1, but not 4.40.0.0. This means that we cannot allow PA-DSS encrypted data to be migrated to 4.40.0.0 so this check will determine if the company data has been PA-DSS encrypted.

ParameterDescription
sourcePath$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
compCode$ [input, string] Source company code
resultMessage$ [output, string] Message text if there is an error or the company cannot be migrated.
Returns [Numeric]
ValueDescription
-1 Error condition; resultMessage$ will contain error info
0 Company cannot be migrated; resultMessage$ will be message text
1 Company can be migrated; resultMessage$ will be null
FUNCTION CheckSourceForSegmentedFiles(sourcePath$)  

This check is run from the Migration Wizard on source installations below 4.40.0.1 Versions 4.40.0.1 and higher will be supporting conversion of segmented files.

ParameterDescription
sourcePath$ [input, string] Path to the source installation.
Returns [Numeric]
ValueDescription
-1 Error condition - unable to check for segmented files
0 Source does not have segmented files
1 Source may have segmented files - MB parameter is set
FUNCTION CheckTargetForPADSS()  

Determine if the current version supports PA-DSS. If it does then it doesn't matter if source data is PA-DSS encrypted or not.

Returns [Boolean]
ValueDescription
0 retFailure Target installation does not support PA-DSS
1 retSUCCESS Target installation supports PA-DSS
FUNCTION ClearEESIntegrationPort(compCode$)  

This method will clear the integration engine port number in the CU_MASOptions file for the entered company. This is done to force a user to re-enter the port number along with any other settings needed for CU after migrating.

ParameterDescription
compCode$ [input, string] Company code for which EES integration engine prot number will be cleared.
Returns [Boolean]
ValueDescription
0 retFAILURE Error occurred.
1 retSUCCESS Integration engine port number cleared.
FUNCTION CloseLauncher()  
Returns [Numeric]
ValueDescription
1 retSUCCESS Always returns success
FUNCTION CompanyMigrationTest(sourcePath$, compCode$, resultMessage$)  

Check if company can be migrated by testing Source and target for matching company codes

ParameterDescription
sourcePath$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
compCode$ [input, string] Company Code to be migrated
resultMessage$ [output, string] Message text if there is an error or the company cannot be migrated.
Returns [Numeric]
ValueDescription
-1 Error condition; resultMessage$ will contain error info
0 Company cannot be migrated; resultMessage$ will contain result text
1 Company found in validation file; resultMessage$ will be company key
2 Company found in target file; resultMessage$ will be company key
3 New company that can be migrated; resultMessage$ will be null
FUNCTION ConvertCompanySystemData(srcVersion$)  

Convert company system data. Currently this only calls PL_LevelConversion A warning will be received if Extended Solutions Paperless Office not detected.

ParameterDescription
srcVersion$ {obsolete}[input, string] Source version. No need to pass a value as this will be set to cSourceVersion
Returns [Boolean]
ValueDescription
0 retFAILURE Error occurred.
1 retSUCCESS Company system data converted
FUNCTION ConvertLM()  
FUNCTION ConvertLM(doReconvert)  

Run Library Master Conversion SY_LevelConversion

ParameterDescription
doReconvert {optional}[input, boolean] flag to force reconversion which will clean out the System files as if we had reinstalled
Returns [Boolean]
ValueDescription
0 retFAILURE System conversion failed
1 retSUCCESS System conversion succeeded
FUNCTION CreateActivationRecords(compCode$)  
FUNCTION CreateActivationRecords(compCode$, path$)  

Write company records to SY_Company.M4T and SY0CTL.SOA then update the activation records.

ParameterDescription
compCode$ [input, string] Company Code
path$ {obsolete, optional}[input, string] Path to the source installation. No longer used as of Version 4.50
Returns [Boolean]
ValueDescription
0 retFAILURE Error occurred
1 retSUCCESS Activation records created
FUNCTION CreateSystemFlagFile()  

Create SystemMgrationFlag.txt file in the Migration folder and write our System files migrated message.

Returns [Numeric]
ValueDescription
1 retSUCCESS Always returns success
FUNCTION DataCheck(compCode$, dataPath$, sourceVersion, modCode$, returnMessage$)  

Launch pre-migration data checks as needed. Currently we only run the IMBalanceTest for the I/M Module.

ParameterDescription
compCode$ [input, string] Company Code for which data will eb checked
dataPath$ [input, string] Path to the company data. Path must be down to XXCCC folder for company data.
sourceVersion {not used} [input, numeric]
modCode$ {not used} [input, string]
returnMessage$ [output, string] Message text if there is an error or other message.
Returns [Numeric]
ValueDescription
-1 Exception error in call, abort program
0 No errors and no messages
1 Error with Informational message
2 Error with WARNING message
3 Error with SEVERE message
FUNCTION DeleteSessionWorktables()  
FUNCTION DeleteSessionWorktables(companyCode$)  

Deletes session worktables

ParameterDescription
companyCode$ [input, string] Company code for session worktable deletion.
ValueDescription
0 isFALSE Unexpected failure
1 isTRUE Success
FUNCTION GetCompanyPaths(mas90Path$, compCode$, companyDataPath$, companyPayrollPath$)  

Get source company data and payroll data paths.

ParameterDescription
mas90Path$ [input, string] path to MAS90 installation
compCode$ [input, string] Company code for which to get data paths
companyDataPath$ [output, string] Path to company data.
companyPayrollPath$ [output, string] Path to company payroll data.
Returns [Numeric]
ValueDescription
1 retSUCCESS Always returns success
FUNCTION GetCRMCompanyList(list$)  

Returns a list of CRM-integrated companies from the source installation's CU_MAS_COMPANY table. The list is separated by pipes ("|").

ParameterDescription
list$ [output, string] list of CRM-integrated companies seperated by pipes ("|").
Returns [Numeric]
ValueDescription
count Returns count containing number of CRM-Intgrated companies. Will be zero if no CRM-integrated companies
FUNCTION GetDirectorySize(path$, fileMask$, subDirs)  

Read all the files in the directory and accumulate a total size

ParameterDescription
path$ [input, string]
fileMask$ [input, string]
subDirs [input, string]
Returns [Numeric]
ValueDescription
dirSize Will return 0 or value representing the directory size
FUNCTION GetInstalledModules(list$)  
FUNCTION GetInstalledModules(list$, path$)  

Returns a pipe delimited list of module codes that have been installed to be used by InstallShield to call the Install() method. SYS is at the beginning of the list.

ParameterDescription
list$ [output, string] Comma delimited list of installed modules. SYS will be the first module in the list.
path$ {optional}[input, string] path to MAS_SYSTEM folder
Returns [Boolean]
ValueDescription
0 retFAILURE falied to open SY_Module. Sets LastErrorNum and LastErrorMsg
1 retSUCCESS Modules returned in list$
FUNCTION GetRegistration(company$, reseller$, serial$, custID$, userKey$, prodKey$)  

Read SY_System to get the registration information from the target

ParameterDescription
company$ [output, string] Registered customer
reseller$ [output, string] Reseller name
serial$ [output, string] Serial number
custID$ [output, string] Customer identification number
userKey$ [output, string] User license key
prodKey$ [output, string] Product license key
Returns [Boolean]
ValueDescription
0 retFAILURE Registration information could not be set
1 retSUCCESS Registration inforamtion set.
FUNCTION GetSourceCompanies(path$)  
FUNCTION GetSourceCompanies(path$, list$)  

Build a list of company codes and names with a flag to indicate if they exist in the target installation. The list is saved in a text file and also returned in the list$ argument.

ParameterDescription
path$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
list$ {optional) [output, string] List of company codes and names with a flag to indicate if they exist in the target installation.
Returns [Numeric]
ValueDescription
0 Returns 0 if no companies found.
count Returns number indicating how many companies were found.
FUNCTION GetSourcePayrollVersion(sourcePayrollVersion$)  

Returns the cached value of the Payroll 2.0 version on the source installation (SY_System.PayrollVersion$) Depends on GetVersionLevels(sourcePath$, ...) having been called and cSourceVersion being set.

ParameterDescription
sourcePayrollVersion$ [output, string] The Payroll 2.0 version on the source install.
Returns [Boolean]
ValueDescription
retSUCCESS if cSourceVersion has been set and thus, the source payroll version has been read.
retFAILURE if cSourceVersion has not been set.
FUNCTION GetTargetCompanyPaths(companyFile$, compCode$, companyDataPath$, companyPayrollPath$)  

Get target company data and payroll data paths.

ParameterDescription
companyFile$ [input, string] Full path + file name to read the target company records from.
compCode$ [input, string] Company code for which to get data paths
companyDataPath$ [output, string] Path to company data.
companyPayrollPath$ [output, string] Path to company payroll data.
Returns [Numeric]
ValueDescription
1 retSUCCESS Always returns success
FUNCTION GetVersionLevels()  
FUNCTION GetVersionLevels(majorLevel, minorLevel, svcPack, svcUpdate)  

Read SY_System and create target version (cTargetVersion) by concatenating majorLevel, minorLevel, svcPack and svcUpdate. Depending on version, may need to get the information from SY_Module or from the SY0CTL.soa lSYS record.

ParameterDescription
majorLevel {optional}[output, numeric] Installation Major Version
minorLevel {optional}[output, numeric] Installation Minor Version
svcPack {optional}[output, numeric] Installation Service/Product Update Version
svcUpdate {optional}[output, numeric] Installation Service/Product Update Version
Returns [Boolean]
ValueDescription
0 retFAILURE Falied to open SY_SYSTEM.
1 retSUCCESS Sets target version as cTargetVersion
FUNCTION GetVersionLevels(sourcePath$, majorLevel, minorLevel, svcPack, svcUpdate)  

Read SY_System and create source version (cSourceVersion) by concatenating majorLevel, minorLevel, svcPack and svcUpdate. Depending on version, may need to get the information from SY_Module or from the SY0CTL.soa lSYS record.

ParameterDescription
sourcePath$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
majorLevel [output, numeric] Installation Major Version
minorLevel [output, numeric] Installation Minor Version
svcPack [output, numeric] Installation Service/Product Update Version
svcUpdate [output, numeric] Installation Service/Product Update Version
Returns [Boolean]
ValueDescription
0 retFAILURE Falied to open SY_SYSTEM or SY_Module.
1 retSUCCESS Sets source version as cSourceVersion
FUNCTION GLAccountTest(path$, special$, nofAccounts$)  

Call GL_Version3AccountCheck.M4P;CHECK_ACCOUNTS

ParameterDescription
path$ [input, string] Path to source installation
special$ [output, string] If return value is 0 or 2, a string of the invalid characters encountered will also be passed back.
nofAccounts$ [output, string] Contains list of NOF Accounts found if any.
Returns [Numeric]
ValueDescription
-2 Exception error. Set LastErrorNum$ adn lastErroMSG$
0 Conversion may not proceed because invalid characters do exist and converting them to blanks would result in duplicate or invalid accounts.
1 conversion may proceed because all accounts are currently valid.
2 There are invalid characters, but they could be safely converted and the user has an option
FUNCTION IMBalanceTest(compCode$, path$, returnMessage$)  

Call IM_Version3BalanceCheck.m4P

ParameterDescription
compCode$ [input, string] Company code for which balances will be checked
path$ [input, string] path must be down to XXCCC folder for company data
returnMessage$ [output, string] Message text if there is an error or other message.
Returns [Numeric]
ValueDescription
0 If there are no files to check or all files are balanced.
3 If there is an out of balance condition or there is an error. Sets returnMessage$
FUNCTION IsSessionWorktable(filename$)  

Determines if filename$ is a session worktable

ParameterDescription
filename$ [input, string] Can be a full path, relative path or filename with extension
ValueDescription
0 isFALSE filename$ is not a session worktable
1 isTRUE filename$ is a session worktable
FUNCTION LogonUser()  
FUNCTION LogonUser(password$)  
FUNCTION LogonUser(password$, sourcePath$)  

Logon to the system. Only the administrator can run the migration if security is set up. The Migration Wizard program will first assume that no security is configured, but this method will return failure if security really is set. In that case, the Migration Wizard will obtain an administrator password from the user and call this method with it.

ParameterDescription
password$ {optiona}[input, string] Administrator password passed in from Migration
sourcePath$ {optiona}[input, string] path to the source installation
Returns [Boolean]
ValueDescription
0 retFAILURE Could not validate administrator password or logon the user
1 retSUCCESS Administrator password is valid
FUNCTION MigrateCompanySystemData(compCode$, srcPath$)  

Migrate system file data. Currently, the list of "Company Specific System Tables" includes the Paperless Office log files and C/U data files. This may be expanded in future development.

ParameterDescription
compCode$ [input, string] Company code for which company system data will be migrated.
srcPath$ {obsolete}[input, string] Path to the source installation. No longer used as of Version 4.50
Returns [Numeric]
ValueDescription
1 retSUCCESS Always returns success
FUNCTION PurgeKDF()  

Purge records from the ProvideX.kdf

Returns [Boolean]
ValueDescription
0 retFAILURE Error encountered purging ProvideX.KDF
1 retSUCCESS Providex.KDF purged
FUNCTION ResetForPayroll()  

Drops and re-creates the SY_Installation object for the payroll app using the overloaded constructor.

Returns [bool] retSUCCESS if the installation object was created, otherwise false.
FUNCTION SetMigrateSystemFiles(setting)  

Call SetMigrateSystemFiles from SY_Installation and set the cmigratSystemFiles flag

ParameterDescription
setting [input, boolean] indicates if user selected to migrate system files as part of Migration
No return value
FUNCTION SetSourceCompanyPiiKey()  

Populates the CI_Options records for all the companies on the source installation with the PII encryption key from the source SY_System record.

Returns [bool] retSUCCESS if an encryption key was set, otherwise false.
FUNCTION SetSourcePath(path$, sqlSvr$, sqlUsr$, sqlPwd$)  

Set the source path and migration type (PVX2PVX,PVX2SQQL,SQL2SQL).

ParameterDescription
path$ [input, string] Path to source installation
sqlSvr$ [input, string] Name of SQL Server
sqlUsr$ [input, string] SQL User. Only for SQL to SQL migration
sqlPwd$ [input, string] SQL user password. Only for SQL to SQL migration.
Returns [Boolean]
ValueDescription
0 retFAILURE Only if migrating SQL to SQL and the ProvideX.KDF cannot be found/opened.
1 retSUCCESS Source path and migration type set.
FUNCTION SetSQLMigrationObject()  

Set handle to SY_MigrationSQL

Returns [Boolean]
ValueDescription
0 FAILURE No handle set
1 SUCCESS Handle to SY_MigrationSQL set
FUNCTION SetSQLSettings(sqlSvr$, trusted, sqlLogin$, sqlPassword$)  

Set the SQL settings by calling SetSqlSettings from SY_Installation.

ParameterDescription
sqlSvr$ [input, string] Name of SQL Server
trusted [input, boolean] flag indicating if the SQL connection is trusted
sqlLogin$ [input, string] SQL User Login.
sqlPassword$ [input, string] SQL user password.
Returns [Boolean]
ValueDescription
0 retFAILURE SQL settings could not set
1 retSUCCESS SQL settings were set.
FUNCTION SetTargetCompanyPiiKeys()  

Populates the CI_Options record on the target installation with the PII encryption key from the target SY_System record for companies where the encryption key in CI_Options is blank. If the company has a PII key in CI_Options it is assumed to be correct for that company's data.

Returns [bool] retSUCCESS if the encryption keys were set, otherwise false.

Properties inherited from: SY_Password

AESCipher$, AES256Cipher$

Methods inherited from: SY_Password

ConfirmAESKey(), ConfirmPassword(), EncryptAESData(), EncryptAESKey(), EncryptAESPassword(), EncryptPassword(), GetAESDataTest$(), PasswordAcceptable(), ValidateAESData(), ValidateAESPassword(), ValidatePassword(), VerifyAESDataEncryption(), DecryptAESData(), DecryptAESKey(), DecryptAESPassword(), DecryptAltAESData(), DecryptPassword(), EncryptAltAESData(), GetKEK$(), InitAESKey(), InitializeAES(), InitializeAltAES(), ValidateAltAESData(), VerifyAltAESDataEncryption()