Moving a project from a factory to another

Introduction

The export / import feature has been developed to migrate a project from a redpesk factory to another.

The export creates a .zip archive that you can download and then import in the destination factory.

The archive from the export contains all the metadata of the project and his applications, but builds and tests for instance are not exported.
Thus you will have to re-build the project in the new factory.
In addition, the project’s members are not exported to the archive.

WARNINGS :

  • For now, we don’t support the import of project with dependencies / inheritances.
  • For now, the export / import is available for a standard project only.
  • For now, import is only possible if the selected distribution(s) exist in the factory where you import the project.

Export

Web UI

Follow these steps in order to export a project:

  • Go to “Projects” tab
  • Click on the project you want to export
  • Then go to “SETTINGS” tab
  • Then scroll down to “Export project” section
  • Click on “GENERATE EXPORT”
  • When the export is done, click on “DOWNLOAD EXPORT”

rp-cli

It is also possible to export a project from redpesk command line, alias rp-cli. In order to do that you only need the slug of the project you want to export and the directory where you want to download the project archive.

In order to get the slug of your project, you can use the rp-cli projects list as below.

$ rp-cli projects list
ID                                        Slug                        Name                        Version        Type
73027643-f827-40c4-ad13-86748c0b99b6      iot-project                 IOT Project                 [Not set]      standard
1fd09a37-cf76-4ce0-9833-b7c346381aa6      my-new-project              New project                 [Not set]      standard
b1a06375-0d28-4091-b9d6-4603cebe85dd      redpesk-ci                  Redpesk CI                  [Not set]      standard
77a6df2a-918a-4fff-a108-8c5f0ab4dc80      redpesk-industrial          Redpesk Industrial          [Not set]      standard
74c88f7a-3f5a-4072-bb29-2291fa8bc05a      redpesk-industrial-image    Redpesk Industrial Image    [Not set]      standard

Then, run the following command (adapt the target repository to your configuration):

$ rp-cli projects export start redpesk-industrial -d /tmp/
-- Project export requested by user --
Requesting export of project "redpesk-industrial"...    [OK]
Waiting for export to be complete...     [OK]
Downloading the archive...               [OK]
Path to the exported project archive: /tmp/redpesk-industrial_export_archive.zip

As reported by rp-cli, the archive is saved in the provided directory.

Import

Web UI

For now, the archive must be imported into a factory which includes the distribution(s) used by the original project.

In order to import follow these steps:

  • On the dashboard page, go to ”+ PROJECT”
  • Click on “Import project”
  • Click on “UPLOAD PROJECT FROM A FILE”
  • Select the *_export_archive.zip you have downloaded at the end of export step
  • Click on “Open”
  • Click on “UPLOAD FILE”
  • When import is done click on “IMPORT PROJECT”

Now you can build your new imported project.

rp-cli

As for export, it is possible to import a project with rp-cli. To do so you only need to provide rp-cli with the path to the project archive, as shown in the following command line:

$ rp-cli projects import start --file /tmp/redpesk-industrial_export_archive.zip
-- Project import requested by user --
Uploading the project archive...        [OK]
Requesting for project import...        [OK]
Waiting for import to be complete...    [OK]

If everything is “[OK]” you are now able to see your project in the Web UI or with rp-cli, using the rp-cli projects list command.