Shinobi
Documentation

How to Migrate your Shinobi to another Machine

Learn to move your Shinobi from one machine to another.

Shinobi is installed at /home/Shinobi by default. Please have your new machine have the Operating System installed and ready for installing Shinobi. Do not install Shinobi on it until backup steps are completed.

You may need to be root to do these steps.

  • Videos Folder : /home/Shinobi/videos
  • SQL Database : /var/lib/mysql
  • Configuration File : /home/Shinobi/conf.json
  • Superuser Credentials : /home/Shinobi/super.json
  1. Click your Username in the top left.
  2. Select Monitors.
  3. Select all the Monitors (or your desired ones) and click Export.
  4. A file will be downloaded, keep this in a safe place. These are your Monitor configurations.

There are two ways to do this. One may seem easier than the other depending on your experience.

Direct Copy of /var/lib/mysql

You can make a direct copy of this directory and place in the exact same place on your new machine. Then you can install Shinobi.

mysqldump

You can use the command line to dump the database then re-import later when you have MariaDB (MySQL) installed.

mysqldump -p ccio > /home/ShinobiDatabaseBackup.sql

The file that is created will be the contents of your database. Just import this SQL file after installing Shinobi.

Navigate to your Shinobi folder and copy the following files to a safe directory.

  • conf.json
  • super.json

Once Shinobi is installed place these files in your Shinobi folder.

After installing and Stopping Shinobi you can place your videos into the filesystem. Do not start Shinobi without importing your SQL database first.

/home/Shinobi/videos is the default location. Place it in the same place in your new machine's Shinobi installation.

This can only be done once a fresh Shinobi is installed.

Navigate to the directory where your dump is located and run the following.

mysql
use ccio;
source /home/ShinobiDatabaseBackup.sql;
exit;

Now your database is imported and you can restart Shinobi.

pm2 restart all
  1. Create backup of Monitors
  2. Create backup of Database
    • If you choose to copy the directory, you must place the copied folder (/var/lib/mysql) on the new machine before beginning installation . If you are importing the mysqldump then you can run the import after installation of Shinobi .
  3. Create backup of Configuration and  Superuser Credentials
  4. Install Shinobi
  5. Stop Shinobi
    • pm2 stop all
  6. Copy Videos to Filesystem
  7. Copy over the conf.json and super.json files into the new Shinobi folder
  8. Import the mysqldump you made previously
    • Only if you don't decide to copy the /var/lib/mysql folder instead.
  9. Restart Shinobi
    • pm2 restart all

ShinobiDocs

All content is property of their respective owners.