Icon

kn_​005_​backup_​workflow

create your own backup system of KNIME workflows of KNIME workflow groups

This illustrates how you might be able to create your own backup system of KNIME workflows of KNIME workflow groups.

Since they are 'just' folders you could ZIP them and add a timestamp and be done. Later you could decompress them and have your work back. Please note: you might have to refresh the explorer in order to get the data back.
This workflow is meant to demonstrate the possibilities. It was developed on a MacOSX machine with local paths, if you use Windows or Linux please check your settings. To use this in production you might have to make some adaptions. and especially split backup and restore processes!
If you backup your workflow in an executed state (the traffic lights are green) you will also have that data stored with it.
This example assumes your workflow to be backed up is at the same path as the backup workflow. If this is not the case: please adapt.

This illustrates how you might be able to create your own backup system of KNIME workflows of KNIME workflow groups.Since they are 'just' folders you could ZIP them and add a timestamp and be done. Later you could decompress them and have your work back. Please note: you might have to refresh the explorer in order to get the data back.This workflow is meant to demonstrate the possibilities. It was developed on a MacOSX machine with local paths, if you use Windows or Linux please check your settings. To use this in production you might have to make some adaptions. and especially split backup and restore processes!If you backup your workflow in an executed state (the traffic lights are green) you will also have that data stored with it.This example assumes your workflow to be backed up is at the same path as the backup workflow. If this is not the case: please adapt.https://forum.knime.com/t/copy-move-files-node/29412/15?u=mlauber71 determine the execution time and turn that into a timestamp RESTORE process (if you want to have this in production you will have to make some changes) var_path_backup_worflowcurrent day&timeyyyyMMdd_HHmmss=> choose the time formatvar_path_backupvar_path_parent_foldervar_pos_namefile.separatordeterminepath and name of workflowvar_wf_name=> name of the workflow to be backed up"kn_001_sample_workflow_to_backup"var_path_backup_zip_fileclear the/restore/folder of a workflowof that name"kn_001_sample_workflow_to_backup"var_path_restorelist all ZIPfiles for folderwith the nameof the workflow"kn_001_sample_workflow_to_backup"sort by datestampselect the newestfilerestore the workflowfrom the newest ZIP fileto /restore/... locationvar_path_restore_file_folder=> folder with the nameof the KNIME workflow tobe backed up"kn_001_sample_workflow_to_backup"var_path_restore_patternzip workflowto /backup/foldervar_path_backup_worflow=> the location of the workflow to be backupedvar_path_backup_zip_file=> the ZIP file that will be createdtry deleteSTARTtry deleteSTOP Java EditVariable (simple) Create Date&TimeRange Date&Time to String Java Snippet(simple) String Manipulation String Manipulation Java EditVariable (simple) Extract ContextProperties Variable toTable Row Table Rowto Variable Table Rowto Variable Merge Variables Java EditVariable (simple) String to Path(Variable) Java EditVariable (simple) DeleteFiles/Folders Java EditVariable (simple) List Files/Folders Sorter Row Filter Table Rowto Variable Decompress Files Java EditVariable (simple) Java EditVariable (simple) CompressFiles/Folder Try (VariablePorts) Merge Variables Catch Errors(Var Ports) This illustrates how you might be able to create your own backup system of KNIME workflows of KNIME workflow groups.Since they are 'just' folders you could ZIP them and add a timestamp and be done. Later you could decompress them and have your work back. Please note: you might have to refresh the explorer in order to get the data back.This workflow is meant to demonstrate the possibilities. It was developed on a MacOSX machine with local paths, if you use Windows or Linux please check your settings. To use this in production you might have to make some adaptions. and especially split backup and restore processes!If you backup your workflow in an executed state (the traffic lights are green) you will also have that data stored with it.This example assumes your workflow to be backed up is at the same path as the backup workflow. If this is not the case: please adapt.https://forum.knime.com/t/copy-move-files-node/29412/15?u=mlauber71 determine the execution time and turn that into a timestamp RESTORE process (if you want to have this in production you will have to make some changes) var_path_backup_worflowcurrent day&timeyyyyMMdd_HHmmss=> choose the time formatvar_path_backupvar_path_parent_foldervar_pos_namefile.separatordeterminepath and name of workflowvar_wf_name=> name of the workflow to be backed up"kn_001_sample_workflow_to_backup"var_path_backup_zip_fileclear the/restore/folder of a workflowof that name"kn_001_sample_workflow_to_backup"var_path_restorelist all ZIPfiles for folderwith the nameof the workflow"kn_001_sample_workflow_to_backup"sort by datestampselect the newestfilerestore the workflowfrom the newest ZIP fileto /restore/... locationvar_path_restore_file_folder=> folder with the nameof the KNIME workflow tobe backed up"kn_001_sample_workflow_to_backup"var_path_restore_patternzip workflowto /backup/foldervar_path_backup_worflow=> the location of the workflow to be backupedvar_path_backup_zip_file=> the ZIP file that will be createdtry deleteSTARTtry deleteSTOP Java EditVariable (simple) Create Date&TimeRange Date&Time to String Java Snippet(simple) String Manipulation String Manipulation Java EditVariable (simple) Extract ContextProperties Variable toTable Row Table Rowto Variable Table Rowto Variable Merge Variables Java EditVariable (simple) String to Path(Variable) Java EditVariable (simple) DeleteFiles/Folders Java EditVariable (simple) List Files/Folders Sorter Row Filter Table Rowto Variable Decompress Files Java EditVariable (simple) Java EditVariable (simple) CompressFiles/Folder Try (VariablePorts) Merge Variables Catch Errors(Var Ports)

Nodes

Extensions

Links