The goal is moving a large global from a database to another while your application is running.
When you use a GBLOKCOPY, you should stop your application (or a part of your application) to avoid writing into the copied global.
Depending your global size and fragmentation, the copy can take while (a few seconds, minutes, hours ...).
The easiest way is simply stop application, perform a GBLOCKCOPY and then apply a global mapping.
Whatever the reason sometimes, you can't do that. Stopping the application a few hours is just impossible (contractual up time reason, ...).
When a GBLOKCOPY is not enough this tool could help you or just open your mind to other possibilities.
You have a large application with large databases\globals and you need to change the storage architecture.
This is very simple, but there is a few steps :
Don't use with an active mirror!
After the copy, if a switch occurs to a node without the correct global mapping configuration, it would be disastrous.
Don't use with ECP!
Currently not tested with application server.
This is experimental, don't use without testing!
Under MIT License, use this tool at your own risk.
Feel free to improve or modify as needed.
BACKUP your data before running
Prepare a recovery plan related to this operation.
Run this operation during off-peak hours.
This needs to have git and docker installed.
$ git clone https://github.com/lscalese/isc-live-global-mover
$ docker-compose build
$ docker-compose up -d
zpm install live-global-mover
The unit test perform two operations :
See class Iris.Tools.Test.TestGlobalMover
Starting unit test :
zn "IRISAPP" Set ^UnitTestRoot = "/irisdev/app/tests/" Do ##class(%UnitTest.Manager).RunTest(,"/nodelete")
Set mover = ##class(Iris.Tools.LiveGlobalMover).%New() Set mover.global = $lb("^YourGlobalToMoveD") Set mover.dbSource = "irisapp" Set mover.dbTarget = "targetdb" Set tSc = mover.move()
Explore your data, check global mapping.
Data aren't deleted by default from the source database.
You should delete it manually or set mover.deleteSourceDataAfterMoving=1 for automatic deletion.
Logs trace are stored in ^LiveGlobalMover.log. Show log:
This repository is ready to code in VSCode with ObjectScript plugin. Install VSCode and ObjectScript plugin and open the folder in VSCode. Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
Feel free to delete PackageSample folder and place your ObjectScript classes in a form /src/cls/Package/Classname.cls
The script in Installer.cls will import everything you place under /src/cls into IRIS.
The simplest dockerfile which starts IRIS and imports Installer.cls and then runs the Installer.setup method, which creates IRISAPP Namespace and imports ObjectScript code from /src folder into it. Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders. Use .env/ file to adjust the dockerfile being used in docker-compose.
Settings file to let you immedietly code in VSCode with VSCode ObjectScript plugin)
Config file if you want to debug with VSCode ObjectScript