Change instance

Hello everyone,

I will probably change my current installation, which is an old mini PC, for a Beelink S13.

I wanted to know if there is a « tutorial » in the documentation or on the forum explaining the procedure to, on the one hand, erase the old mini PC and then reconnect to the new installation.

Is there a particular way to do it or is it simply a matter of connecting after the installation? Does the backup via Gladys Plus allow, after the installation of Gladys OS, to find everything directly again?

Thank you for your help

Hi @Damien,

Great choice, the Beelink Mini S13 is exactly the mini-PC we recommend for Gladys :slightly_smiling_face:

To answer directly: yes, the Gladys Plus backup is made for this. At the end of the Gladys Assistant OS installation, instead of creating an account, you click on « Gladys Plus Restoration » and you find your instance as it was: users, houses and rooms, devices, scenes, dashboards, integration settings and all sensor history. Zigbee2mqtt and Matter are also restored, as Gladys saves their configuration in its database every night.

There are just a few precautions to take. Here is the procedure in order.

1. Before changing (on the old mini-PC)

  1. Note your backup key: Settings → Gladys Plus → « Backup Key » (click on the eye to display it). Backups are encrypted with this key: without it, it is impossible to restore them. :warning: Do not disconnect Gladys Plus from the old instance before noting it, disconnecting erases the key from the instance.
  2. If you use the MQTT integration with the broker installed by Gladys (for Tasmota, Shelly, etc.): also note the MQTT username and password (Integrations → MQTT → Configuration). You will need them in step 3.
  3. If you use Node-RED: export your flows (menu ☰ → Export → All flows). They are not in the Gladys backup.
  4. Do not pair any new Zigbee or Matter device just before migration. The Zigbee2mqtt configuration is saved in Gladys every night at 11 p.m., and Matter’s at 4 a.m. A device paired after the last nightly backup would need to be re-paired.
  5. Launch a manual backup: Settings → Backups → « Backup now ». Wait for it to appear in the list.
  6. Turn off the old mini-PC. The two machines must never run at the same time: they would control the same devices, your scenes would trigger twice, and they would share the same Gladys Plus connection.
  7. Unplug your Zigbee dongle (and your other USB dongles) and plug it into the Beelink. If your Zigbee coordinator is a network model (SLZB-06, etc.), there is nothing to move.

2. Beelink Installation

Follow the Gladys Assistant OS documentation: Install Gladys Assistant on a mini-PC with Gladys Assistant OS | Gladys Assistant
In summary: you write the image to a USB key, you start the Beelink on it (press F7 at startup), you answer a few questions, and Gladys installs itself.

When http://gladysassistant.local displays the welcome screen:

  1. Click on « Gladys Plus Restoration » (and not on « Create a local account »).
  2. Log in with your Gladys Plus account (email, password, double authentication code).
  3. Enter your restoration key: it’s the backup key noted in step 1.
  4. Choose the most recent backup, then click on « Restore » and « Confirm ».
  5. At the end, Gladys restarts by itself. You then log in with your usual Gladys account, with the email and password of your old instance.

The restoration takes more or less time depending on the size of your history.

3. Verifications after restoration

  • Zigbee2mqtt : Gladys automatically reinstalls it with its configuration restored (Zigbee network and devices), so there’s no need to re-pair. Still, go to Integrations → Zigbee2mqtt to check the USB port of the dongle: it may have a different name on the new machine. In this case, select the correct one.
  • Matter : the controller is automatically restored from its backup.
  • Catalog integrations : they are automatically reinstalled on startup. Gladys redownloads their images, which can take a few minutes.
  • MQTT (if you use the broker installed by Gladys) : while preparing this response, I just realized that the broker container is not automatically recreated after a restore on a new machine. I’ll fix that! In the meantime, in Integrations → MQTT → Configuration, click on « Install the broker on Docker ». Gladys then generates a new password: enter your old credentials and save, otherwise your MQTT devices won’t be able to connect.
  • Node-RED : reimport your flows.
  • IP address : the Beelink will have a new IP address. Everything that contacts Gladys via its IP (MQTT devices, etc.) must use the new one. The easiest way, once the old one is turned off: in your box settings, assign the Beelink the static IP address that the old mini-PC had (DHCP reservation).
  • Gladys Plus : your Gladys Plus connection is part of the backup, so it’s the Beelink that takes the place of the old one. Check that the instance is properly connected in Settings → Gladys Plus, and test remote access at https://plus.gladysassistant.com. The next day, check that a new backup appears in Settings → Backups.

4. Erase the old mini-PC

Keep it turned off for a few days, time to check that everything works: it’s your plan B. Never turn it back on while Gladys is running and the Beelink is operating.

After that, its disk still contains your Gladys database (users, Gladys Plus keys, access to your integrations). So:

  • if you give it away or sell it, reinstall a system by completely erasing the disk;
  • if you keep it for something else, delete the Gladys containers and data:
docker rm -f gladys gladys-z2m-zigbee2mqtt gladys-z2m-mqtt eclipse-mosquitto gladys-node-red
sudo rm -rf /var/lib/gladysassistant

Adjust the container list to what docker ps -a shows on your system (for example, add watchtower if it is installed).

No need to disconnect Gladys Plus on the old mini-PC: it’s the Beelink that has taken over the connection.

If you get stuck at any step, don’t hesitate to come back here!

That’s very clear, thank you so much!

Hi everyone!

This topic is now in development.

A PR has been opened to recreate the missing embedded MQTT broker with the already registered credentials (after restoring a backup):

Feel free to follow the PR, test (optional, especially for small requests) and give your feedback here if needed.

This step-by-step procedure will be very useful for me too! Thanks @pierre-gilles

I’m thinking: maybe it would fit in an official documentation page?