@hoobs/migration

4.4.24 • Public • Published

HOOBS migration utility. This utility can migrate a HOOBS 3 or Homebridge setup to HOOBS 4.

Installing

Use NPM to install this utility globally;

sudo npm install -g @hoobs/migration

Usage

To run the migration tool simply run this command.

sudo hbs-migrate

This will show you a list of steps the migration tool will take to upgrate to HOOBS 4. You will be asked if you want to execute the plan.

By default this assumes that you are running this tool on the system to be migrated. It will generate a script to be ran on boot. Your device will reboot a few times.

Transfering

If you want to transfer this setup to a new device or plan on re-flashing your sd card, you can use the -t or --transfer flag.

cd ~/
sudo hbs-migrate -t

Then from another computer you can use scp to transfer the backup.

scp hoobs@hoobs.local:~/migration.backup ./

Note. The above example if for a default HOOBS Box. You may need to change the username and/or hostname depending on your setup.

Note. If you are transfering the backup file using macOS, scp is available in the terminal. If using Windows 10, PowerShell has an scp command.

It is recommended that you power down your current device before restoring your new device or new SD card. This will prevent network collisions.

On you new HOOBS 4 setup, you can restore it, using the migration.backup file, from the Hub Settings dialog.

Command Line

This tool has flags that can automate parts of the migtation routine.

Flag Shorthand Parameters Description
--app -a hoobs or homebridge select the application you are migrating from
--unattended -y automatically execute the migration
--split -s split plugins into individual bridges
--transfer -t generate backup for transfer to another device
--debug -d used to migrate without executing the scripts

Module

This tool can also be used as a module in code.

const Migration = require("@hoobs/migration");

// first setup the tasks object
const tasks = new Migration.tasks(/* transfer: [true | false] */);

// you need to fetch a list of instances
const instances = Migration.instance.paths(/* app: [hoobs | homebridge] */);

// next start the system interrogation and execute the tasks
tasks.interrogate(
    /* app :[hoobs | homebridge] */,
    instances[0], // <-- example, it's best to ask the user which instance to migrate
    /* split: [true | false] */,
).then(() => {
    tasks.execute(/* path: [string | undefined] */).then(() => {
        console.log("complete");
    });
});

The tasks.execute() function can either reboot the system and migrate to HOOBS 4 or it can save a migration backup file to the path specified.

If you plan on only creating a migration backup file, you must set the transfer flag to true when creating the tasks object.

Legal

HOOBS and the HOOBS logo are registered trademarks of HOOBS Inc. Copyright (C) 2020 HOOBS Inc. All rights reserved.

Readme

Keywords

none

Package Sidebar

Install

npm i @hoobs/migration

Weekly Downloads

10

Version

4.4.24

License

GPL-3.0

Unpacked Size

90.9 kB

Total Files

14

Last publish

Collaborators

  • pminder
  • pfy
  • mkellsy
  • askovi
  • bobbyslope