How to copy database via ETL

How to copy database via ETL

In this article, we will show you how to copy databases via ETL. This method does not require a service restart. All you need is a groovy script that is run in Groovy job. For this example, we will use the "Demo" database. Groovy scriptcopyJedoxDatabase( 'Demo', 'Demo_Copy' )void copyJedoxDatabase( String jedoxConnectionSrc, String jedoxDatabaseDst ) {String jedoxDatabaseSrc = OLAP.getDatabase( jedoxConnectionSrc ).getName()String backupFilename = API.getProperty( "Demo_Copy" ) + jedoxDatabaseSrc + '.zip'// Remove backupFile if exists (e.g. from a previous run)new File( backupFilename ).delete()IDatabase db = OLAP.getDatabase( jedoxConnectionSrc )LOG.info( 'Saving database ' + jedoxDatabaseSrc + ' to ' + backupFilename )db.backup( backupFilename )IConnection conn = OLAP.getConnection( jedoxConnectionSrc )LOG.info( 'Restoring database ' + jedoxDatabaseDst + ' from ' + backupFilename )conn.addDatabase( jedoxDatabaseDst, backupFilename )boolean fileSuccessfullyDeleted = new File( backupFilename ).delete()} Once the job is run, the new database will appear in the modeler. ETL job can be downloaded from this location. ...
Read More
How to rename elements from Jedox ETL?

How to rename elements from Jedox ETL?

Sometimes it could happen that there is a request to rename element in modeler outside of the spreahsheet or manual. For that puspose we could use ETL and more speciefically groovy job.In following example we will show how to rename element from User dimension using groovy job.API.executeLoad("Users_Load");LOG.info("Start renaming elements");source = API.initSource("Users_Extract","EA",0);String oldNames = "joe";String newNames = "Martin";OLAP.erename("olapsystem","#_USER_",oldNames as String,newNames as String);LOG.info("Finished renaming elements");In the graph we could see that for this action we need:Extract from dimensionConnection to dimensionETL is extracting all elements and then searching for joe and replacing it with Martin.ETL project could be downloaded on this link.Other PHP APIs could be found here ....
Read More