Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial describes advanced project management techniques in CleverMaps Shell.

...

  • a working copy of the original project (where updates are made, and which later replaces the original project)
  • a base for a branched out, similar project (in order not to start from scratch)
  • a backup of older version of the project (to be archived)


Alternatively, you can use importProject command with --serverSide parameter. Log in to CleverMaps Shell and create a new project using the createProject command.

Code Block
languagetext
themeMidnight
CleverMaps$ login
Found config file: /home/tomas/.cleverMaps/config
	* setting https://secure.clevermaps.io as default server
	* setting /var/local/metadata as default dump directory

Successfully logged in as tomas.schmidl@clevermaps.io (using access token)

tomas.schmidl@secure.clevermaps.io$ createProject --title "Clone of First project"
Created project c2ovon61uudj9lpm
Project c2ovon61uudj9lpm successfully opened
        Project title: Clone of First project
        Organization: CM Trial

Opening dump...
You don't have dump to open for this project.

Then use the importProject command. Specify the --project parameter with the project's ID, and the --serverSide parameter to perform import of the project on the server.

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ importProject --project k5t8mf2a80tay2ng --serverSide
Importing project k5t8mf2a80tay2ng...

Importing of project k5t8mf2a80tay2ng was successful.

After successfully importing project on server, use dumpProject to dump your project. Now you have identical clone of original project.

Restoring a backup dump

Each dump is an image of a project in a specific time. So, a local dump can be used as a backup of a project. It is useful to periodically dump the project you're working on, to save your previous work. This way, in case you break the live project, you can always revert to a previous version of the project.

...

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng/dump:2019-01-30_14-46-52$$ openProject --project c2ovon61uudj9lpm
Project c2ovon61uudj9lpm (First project (clone)) successfully opened
 tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ truncateProject Truncation of project started...  Project wastitle: successfully truncated.

tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ 

Then use listDumps to list previous dumps of the project.

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ listDumps
Listing dumps of project c2ovon61uudj9lpm...

2019-01-30_14-08-31
	Dump date: Wed Jan 30 14:08:31 CET 2019
	Dump server: https://secure.clevermaps.io
	Project title: First project (clone)
	Data content: 
		orp_dwh.csv (24 KB)
		cast_obec_dwh.csv (1 MB)
		zsj_d_dwh.csv (3 MB)
		obec_dwh.csv (761 KB)
		okres_dwh.csv (9 KB)
		transactions.csv (1 MB)
		zsj_dwh.csv (2 MB)
		obec_momc_dwh.csv (754 KB)
		kraj_dwh.csv (1 KB)
	Metadata content: 1 metrics, 17 datasets, 1 indicators, 1 dashboards, 1 views, 1 indicatorDrills

2019-01-30_14-46-52
	Dump date: Wed Jan 30 14:46:52 CET 2019
	Dump server: https://secure.clevermaps.io
	Project title: First project (clone)
	Data content: 
		orp_dwh.csv (24 KB)
		cast_obec_dwh.csv (1 MB)
		zsj_d_dwh.csv (3 MB)
		obec_dwh.csv (761 KB)
		okres_dwh.csv (9 KB)
		transactions.csv (1 MB)
		zsj_dwh.csv (2 MB)
		obec_momc_dwh.csv (754 KB)
		kraj_dwh.csv (1 KB)
	Metadata content: 1 metrics, 17 datasets, 1 indicators, 1 dashboards, 1 views, 1 indicatorDrills

Clone of First project
        Organization: CM Trial

Opening dump...
You don't have dump to open for this project.
tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ truncateProject
Truncation of project started...

Project was successfully truncated.

tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ 

...

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ importProject --dump 2019-01-30_14-08-31
Checking if the project c2ovon61uudj9lpm is empty... OK

Importing local dump 2019-01-30_14-08-31 of project c2ovon61uudj9lpm...

...

Code Block
languagetext
themeMidnight
Import finished!
Source project: c2ovon61uudj9lpm (First project (clone))
Source dump: 2019-01-30_14-08-31
Destination project: c2ovon61uudj9lpm (First project (clone))
Destination
dump: 2019-01-30_16-57-02
Imported metadata objects: 22
Imported CSV files: 9

To view detailed imported content, use status command.
When you're done, use addMetadata command to add the metadata to the project.
To push the data to the project, use pushProject command.

tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm/dump:2019-01-30_16-57-02$ 

The final step to restore the backup dump is to upload the data and metadata to the project. As usually, use addMetadata and pushProject to do that.

Info
titleImport usage

The importProject command can import either a project from a server, or a local dump or perform import on the server. What to import is decided based on provided parameters.

  • importProject --project {projectId} --server {serverName}
  • importProject --project {projectId} --dump {dumpId}dump 
    • imports a local dump of another project (not the one currently opened)
  • importProject --dump project {dumpIdprojectId} imports a dump of currently opened project--serverSide
    • perform import on the server

Updating a live project

Now that we've done some work on the project clone, we want to transfer the changes to the live project.

...

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io$ openProject --project k5t8mf2a80tay2ng
Project k5t8mf2a80tay2ng (First project) successfully opened

tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng$ truncateProject
Truncation of project started...

Project was successfully truncated.

tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng$ 

Now, we will import the latest dump of the clone project, where we've done all the work. Use importProject command with both --dump and --project parameters.

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng$ importProject --project c2ovon61uudj9lpm --dump
2019-01-30_17-12-09
Checking if the project k5t8mf2a80tay2ng is empty... OK

Importing local dump 2019-01-30_17-12-09 of project c2ovon61uudj9lpm...

...

Code Block
languagetext
themeMidnight
Import finished!
Source project: c2ovon61uudj9lpm (First project (clone))
Source dump: 2019-01-30_17-12-09
Destination project: k5t8mf2a80tay2ng (First project)
Destination dump: 2019-01-30_17-23-40
Imported metadata objects: 22
Imported CSV files: 9

To view detailed imported content, use status command.
When you're done, use addMetadata command to add the metadata to the project.
To push the data to the project, use pushProject command.

tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng/dump:2019-01-30_17-23-40$$ 

And as the finish message tells us, use the usual addMetadata and pushProject commands to upload the updated dump to the live project.

...

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng/dump:2019-01-30_17-23-40$$ editProject --project k5t8mf2a80tay2ng --newStatus enabled
Project status changed to "enabled"

tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng/dump:2019-01-30_17-23-40$$ 


Info
iconfalse

(tick) That's it! You've learned some advanced project management techniques. What about the project clone? This is up to you, but it's best to keep it, since it will be available the next time you have to update the live project.

...