Backing up and restoring the data of Harbour apps

Jolla Care -

This special procedure is needed and can be used because the current backup utility of SailfisOS does not save the data of miscellaneous 3rd party apps apps.

This article contains an example covering one application only.

There is no guarantee that the following instructions would always work or be able to backup all kinds of Harbour apps!

Disclaimers

  1. These instructions are applicable for the so-called Harbour apps which are SailfishOS apps from 3rd party developers. They can be installed from Jolla Store.
  2. These instructions do not cover the native SailfishOS apps (e.g. browser, email, calculator, maps).
  3. These instructions do not cover any Android apps.
  4. Anyone using the instructions below does it on his/her own risk. The procedure has been tested briefly but there is no guarantee that it works in all cases.
  5. A good amount of Linux knowledge and technical skills is expected from you to succeed.

General

This article has two main parts, depending on the condition of your Sailfish device:

A. RECOVERY MODE

B. NORMAL MODE

This article presents an example how to handle the data of the game of Snake. Other SailfishOS apps in Jolla Store are expected to keep their data in the same folder: /home/nemo/.local/share . If this is correct for other apps then the instructions below can be modified and used for those other apps, too.

One can check the installed Harbour apps in the device with command (if the app has some data to collect here).

ls -al /home/nemo/.local/share/

Also check if your app(s) have something under the configurations folder:

ls -al /home/nemo/.config/

Required

There must be a micro-SD card in your Sailfish device.

If your Sailfish device is up and running normally, consider accessing the memory card like in  B. NORMAL MODE .

If your Sailfish device cannot be booted up but needs be forced to recovery mode, then we need to mount the card to access it. Proceed to chapter A. RECOVERY MODE below.

 

A. RECOVERY MODE

Our official help articles on recovery mode for various devices are here:
Jolla Phone: Recovery Mode
Jolla C: Recovery Mode
Jolla Tablet: Recovery Mode.

 

A.1. Saving app data to SD card

User has been playing Snake.
He wants to save the game data to make it persist over a phone reset or the re-flashing of the phone.

1. Make a telnet connetion to the device as instructed in the help articles above.
2. Using the Shell utility, give the following commands exactly as they are below:


    mkdir -p /mnt/sd
    mount  /dev/mmcblk1p1 /mnt/sd/
    cd /home/nemo/.local/share
    tar -cvf /mnt/sd/MySnakeData.tar harbour-snake/
    sync

3. If your app has some configurations, then let's save them, too:

    cd /home/nemo/.config
    tar -cvf /mnt/sd/MySnakeConfig.tar harbour-snake/
    sync

4. Unmount the SD card

    umount /mnt/sd

5. Exit recovery mode by detaching the USB cable and the battery from the device .


A.2. Restoring data from SD card to device

1. Install Snake again
2. Launch Snake. This creates the application setup (folder for the app database) to the phone, again.
3. Close Snake app.

Now that your device is running in the normal mode again, consider restoring the data as in chapter B. NORMAL MODE .

Alternatively you can keep going like below, i.e. mounting the SD card.


4. Enable Developer Mode and launch Terminal app (or use SSH).

    devel-su
    mkdir -p /mnt/sd
    mount  /dev/mmcblk1p1 /mnt/sd/

5. First we restore the app data from SD card to device memory

The command copies your data to the actual app folder (here: harbour-snake) and overwrites all files in there:

    tar -xvf /mnt/sd/MySnakeData.tar -C  /home/nemo/.local/share/

6. Next we restore the app configuration from SD card to device memory

The command copies your app configuration to the actual folder (here: harbour-snake) and overwrites all files in there:

    tar -xvf /mnt/sd/MySnakeConfig.tar -C  /home/nemo/.config/

 

A.3. Cleaning up

    umount /mnt/sd
    exit


Close Terminal (or SSH)
Disable Developer Mode (if not needed)
Launch Snake. You should see your previous app data now. Best of luck!

 

B. NORMAL MODE

Your Sailfish device is in its normal mode. It is possible to access the memory card at /media/sdcard/<uuid>. Use the following command to check and copy the unique identifier <uuid> of your card:

ls  /media/sdcard/

Our SSH instructions are here:
 SSH-connection-over-USB-from-Windows
 SSH-connection-over-USB-from-Ubuntu

 

B.1. Saving app data to SD card

User has been playing Snake.
He wants to save the game data to make it persist over a phone reset or the re-flashing of the phone.

1. Enable Developer Mode and launch Terminal app (or use SSH).
2. Give the commands exactly as they are below (but replace <uuid> with the real code):

    devel-su
    cd /home/nemo/.local/share
    tar -cvf /media/sdcard/<uuid>/MySnakeData.tar harbour-snake/
    sync

3. If your app has some configurations, then let's save them, too:

    cd /home/nemo/.config
    tar -cvf /media/sdcard/<uuid>/MySnakeConfig.tar harbour-snake/
    sync

4. Close Terminal (or SSH).

 

B.2. Restoring data from SD card to device

1. Install Snake again
2. Launch Snake. This creates the application setup (folder for the app database) to the phone, again.
3. Close Snake app.
4. Enable Developer Mode and launch Terminal app (or use SSH).

    devel-su

5. First we restore the app data from SD card to device memory

The tar command copies your data to the actual app folder (here: harbour-snake) and overwrites all files in there. Remember to replace <uuid> with the real card identifier:

    tar -xvf /media/sdcard/<uuid>/MySnakeData.tar -C  /home/nemo/.local/share/
    sync

6. Next we restore the app configurations from SD card to device memory

The tar command copies your app configuration to the actual folder (here: harbour-snake) and overwrites all files in there:

    tar -xvf /media/sdcard/<uuid>/MySnakeConfig.tar -C  /home/nemo/.config/
    sync

    exit

Close Terminal (or SSH)
Disable Developer Mode (if not needed)
Launch Snake. You should see your previous app data now. Best of luck!

- - - - -

Have more questions? Submit a request

Comments

Powered by Zendesk