Versions Compared

Key

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

This tutorial describes advanced project management techniques in CleverMaps Shell.

...

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

Successfully logged in as tomas.schmidl@clevermaps.io

tomas.schmidl@secure.clevermaps.io$ createProject --title "First project (clone)"
Created project c2ovon61uudj9lpm
Project c2ovon61uudj9lpm (First project (clone)) successfully opened

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

Then we use the import commandimportProject command. We specify the --project parameter with the project's ID, and the --server parameter to import the project from the server.

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ importimportProject --project k5t8mf2a80tay2ng --server https://secure.clevermaps.io
Validating DWH model/data integrity of project k5t8mf2a80tay2ng... OK

Importing project k5t8mf2a80tay2ng from server https://secure.clevermaps.io...

Let's skip some of the import importProject command output...

Code Block
languagetext
themeMidnight
Import finished!
Source project: k5t8mf2a80tay2ng (First project)
Source server: https://secure.clevermaps.io
Destination project: c2ovon61uudj9lpm (First project (clone))
Destination server: https://secure.clevermaps.io
Imported datasets: 17
Imported metadata objects: 5
Imported CSV files: 9

To view detailed imported content, use status command.
Now you can make changes, or import another project.
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_14-08-31$ 

...

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:c2ovon61uudj9lpm$ importimportProject --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...

Import with --dump parameter will first check if the project is empty. It is, because we've truncated it earlier. This behaviour can be overriden by specifying the --force parameter. 

Let's skip some of the import importProject command output again...

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 import importProject command can import either a project from a server, or a local dump. What to import is decided based on provided parameters.

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

...

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

Code Block
languagetext
themeMidnight
tomas.schmidl@secure.clevermaps.io/project:k5t8mf2a80tay2ng$ importimportProject --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...

Let's skip some of the import importProject command output again...

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.

...