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 script copyJedoxDatabase( '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