# Clone Your Robot

You can migrate or close your current robot images, database, and configuration of Seirios RNS to another robot, depending on your needs.

{% hint style="danger" %}
You couldn't copy the license of your current robot and apply it to another robot, because the license is tied to one robot only. If you want to purchase the license for another robot you can reach us at <sales@movel.ai> or see this [page](https://docs.movel.ai/new-collection/seirios-rns/documentation/installation-and-integration-1/full-licence-activation).
{% endhint %}

## Backup Data

### 1. Backup the custom image from docker

Backing up the custom images *(not the default ones)* is the most important because in our cloud, we don't have any custom images of the clients, we only have the default images. Since custom images may be different for each client/robot.

Usually, the default images are named “*<mark style="color:blue;">registry.gitlab.com/\<path>:\<tag></mark>*”, but the custom images are usually named by adding some word behind the tag like “<mark style="color:blue;">registry.gitlab.com/\<path>:\<tag></mark><mark style="color:blue;">**-\<client>**</mark>” or another name.

1. Check the name of your custom image on your docker-compose.yaml file,&#x20;

<figure><img src="https://lh5.googleusercontent.com/4ohk2J1nM4ssHLp_BMY9YjcwMTlo-CgsoT0-R2MdxjveAMLK_KYmO01AqWkefTZreqcTGIw_ePeylbBCc_rQrlDFkcifqbS3cZpxoNzOmvoHAtxxbE_zW5jX5a_o7XAR3FQTFuDBlJP628-b5R0qPBk" alt=""><figcaption><p>image name on docker-compose.yaml file</p></figcaption></figure>

or you can check on the `docker ps` (if you are already running the container):

<figure><img src="https://lh4.googleusercontent.com/3FMYH3EsRArh72zFfTKgJbkPGRxHZ63jOwAqQYSSLYqWSXRI1c0bbHWY3xfV7rH3S8VEwlyO4Fp15A27DtvQpgvYsefxjCh70Nzay0e34m7qnMgHWW71Zl5mi_eZ1KYkiwEZiG5JLtarRyZhYKNpfJA" alt=""><figcaption><p>docker ps output on terminal</p></figcaption></figure>

2. See the image using `docker image ls` :<br>

   <figure><img src="https://lh4.googleusercontent.com/3AqXh6EsC7Hor8__ht0rZpbz-7N_B-yCSRfK8skCdTz6AY9R2sXyQCQaQa8fa0I021xK9x8ysWjIlNgMeANrEinC39zpWRJ7djJKXqNn-9QVvJHRqiQ4AVY4hq9kBpLht5cQewLrIFK3v-ZlPtt9xTg" alt=""><figcaption><p>docker image ls on terminal</p></figcaption></figure>
3. Save the docker images to a tar archive file:\
   `docker save seirios-ros-development > ~/catkin_ws/movel_ai/seirios-ros-development.tar`\
   Change the *seirios-ros-development* to your custom image name, and you can change the tar filename as well\
   see if the new tar file is generated

   `ls -sh ~/catkin_ws/movel_ai/seirios-ros-development.tar`

### 2. Backup the default images from docker

It’s also important to back up the default images as well because if it’s not, the new PC has to download the images (it took > 6 GB) and also needs a credential key from movel.ai, you can ask the credential key to <sales@movel.ai>.&#x20;

Otherwise, if you want to backup the default images as well, you can also backup the images using the same steps above.

### 3. Back up the database

You probably want to copy all the logs, maps, and some tasks that are already saved on your robot to another robot. So you don't have to do mapping and creating the tasks again.

Please follow the instructions below to back up the database:

1. Go inside the seirios-mongo container, and copy the db to the folder you want to save it inside the container, by executing the following command:

`docker exec -i seirios-mongo /usr/bin/mongodump --db=movelweb --out=/backup_db`

2. Create a folder on the pc, this will be a location for the database file, by executing this command:

`mkdir -p ~/catkin_ws/movel_ai/backup_db`

3. Copy the folder inside the docker container to outside, by following this command:

`docker cp <container_name>:/backup_db ~/catkin_ws/movel_ai/backup_db`

### 4. Back up the config and the \~/catkin\_ws/movel\_ai folder

Since we already copied the database and images to `~/catkin_ws/movel_ai` folder, and the `docker-compose.yaml` and all the configuration files are already on `~/catkin_ws/movel_ai` as well. Then the next step is you can copy all the files and folders on `~/catkin_ws/movel_ai` folder.

**---------------------**

## Restore Data

{% hint style="success" %}
Please make sure you already install the seirios RNS, you can use [easy-deploy](https://docs.movel.ai/new-collection/seirios-rns/documentation/installation-and-integration-1/easy-deploy-for-seirios) for installing the seirios-RNS.
{% endhint %}

{% hint style="info" %}
If you want to clone the seirios-RNS software with all the configs from one robot to another robot, please make sure those robot has the same configuration below:

* Camera ROS topics
* Dimension or Footprint of the robot
* LiDAR ROS topics
* Odometry ROS topics and frame id
* Transformation of the frame
  {% endhint %}

### 1. Restore the docker-compose and config on \~/catkin\_ws/movel\_ai

Please copy `~/catkin_ws/movel_ai` folder from your old robot to the new robot, to restore the docker-compose.yaml and all the configurations.

### 2. Restore the docker image

Since we already copied the image as a tar archive file, you can load it into docker as a docker image file by executing this command:&#x20;

`docker load < ~/catkin_ws/movel_ai/seirios-ros-development.tar`

Change the *seirios-ros-development.tar* to your docker image name.

Then check if all the images are loaded properly or not by executing the following command: `docker image ls` .

### 3. Restore the database

First, make sure you run the seirios-mongo container on the docker.

To restore the database that you already saved before, you can execute the following command on the new PC:&#x20;

`docker exec -i seirios-mongo /usr/bin/mongorestore --db=movelweb ~/catkin_ws/movel_ai/backup_db` .

{% hint style="info" %}
If you have any questions and need help for migrate the software to another PC, please feel free to ask by reaching us at <sales@movel.ai>.
{% endhint %}
