Skip to content

Porta On Prem VM Helpers

Helpers that can be run from the command line when accessing the VM shell terminal via SSH, or directly in the VirtualBox VM terminal.

These commands are often shortcuts to the script files of similar names. You can simply type the command into the terminal and hit Enter.

CommandNotes
collect_data • Run various diagnostics to gather system and app data
• Results stored in ~/logs/collected_data/YYYYMMDD/HH-SS/
0.9.14.2+
view_hosts_filePrint the contents of the hosts file located at /etc/hosts0.9.14.2+
check_diskspaceSimple disk space check0.9.14.2+
check_diskspace_sortedDisk space check sorted by size0.9.14.2+
docker_disk_usageCheck Docker’s disk usage by images, containers, and volumes0.9.14.2+
docker_volume_size• Inspect Docker volume sizes
• Usage: docker_volume_size <volume_name>
0.9.14.2+

VM Location: ~/scripts/

ScriptNotesVersions
reset_identity.sh• Give the VM a new hostname and unique machine ID.
• Should be run when importing the VM image multiple times to avoid conflicts with other VMs.
All
reset_dhcp.sh• When not using static IP, use this to assign a new IP address to the VM.All
setup_static_ip.sh• Sets up a static IP address for the VM.
• ⛔The VM setup PowerShell script automatically sets static IP, so this script should only be needed if the setup script fails to complete properly.
• ⚠️If executed over SSH, your connection will drop — use VirtualBox terminal instead.
All
static_ip_info.sh• Print info about the static IP configuration in /etc/netplan/All
vm_info.sh• Print info about the VM (hostname, IP, MAC address, and /etc/hosts contents)All
disable_static_ip.sh• Attempt to disable static IP configuration by renaming /etc/netplan/99-portacfg.yamlAll

These commands are often shortcuts to the script files of similar names. You can simply type the command into the terminal and hit Enter.

CommandNotesVersions
update_manager • Update Porta Manager
• This will automatically download the latest version of Porta Manager and run the update script.
• Calls the script ~/scripts/porta-manager/install-manager.sh.
All
install_manager • Alias of update_manager.
• Currently, unlike during a Porta install, there is no database wipe of the Porta Manager during installation.
All
mngr_check_versionPrint Porta Manager version info0.9.14.2+
mngr_horizon_logsView the installer wizard server processing logs0.9.14.2+
mngr_app_logsView Porta Manager application logs0.9.14.2+
mngr_task_logsView Porta Manager task logs0.9.14.2+
mngr_init_userInitialize Porta Manager user0.9.14.2+
mngr_backup_envBackup Porta Manager environment0.9.14.2+
mngr_restore_envRestore Porta Manager environment0.9.14.2+
mngr_recreate• Recreate containers from existing images
• Needed if IP is manually changed (without running a script)
• Manager containers must currently be running
0.9.14.2+
⚠️ mngr_wipe_recreate• Wipe the manager completely (including data and storage volumes) and recreate it from existing images • ⚠️THIS IS A DESTRUCTIVE ACTION0.9.14.2+

VM Location: ~/scripts/porta-manager/

ScriptNotesVersions
install-manager.sh• Install or update Porta Manager
• This will automatically download the latest version of Porta Manager and run the update script
All
check-manager-version.shDisplay the current version of Porta Manager that is installed on the VMAll
view-logs.sh• Follow or view the last X lines of logs from a Porta Manager container.
• Defaults to following the horizon container logs.
• Usage: ~/scripts/porta-manager/view-logs.sh [container_type] [number_of_lines]
container_type: app, horizon, or task
number_of_lines: Number of lines to tail, or ‘f’ to follow
• Example for viewing the last 300 lines of the horizon log file: ~/scripts/porta-manager/view-logs.sh app 300
All
check-conn-cache.shCheck the contents of the cached connections (cache file), loaded connections (config() in memory), and database connection cache for all Porta Manager containersAll
init-manager-user.sh• Initialize the first Porta Manager user.
• Only needed if you have fully wiped the Porta Manager database.
All
backup-env.sh• Copy an .env file from the porta manager app container to ${MNGR_CONFIG_DIR}/.env to preserve its APP_KEY between updates.
Is run automatically when updating with update_manager.sh
All

These commands are often shortcuts to the script files or existing helpers of similar names. You can simply type the command into the terminal and hit Enter.

CommandNotesVersions
porta_diagRun the full Porta servers diagnostics0.9.14.2+
porta_all_group_status• View group replication status as reported by each machine in the group.
• ⚠️ Machine IPs must be correct in /etc/hosts
0.9.14.2+
porta_group_statusView group replication status as reported by the local machine0.9.14.2+
porta_check_versionView Porta app version information0.9.14.2+
porta_bootstrap• Bootstraps the replication group from this machine.
• Before running, make sure no other machine is already primary (check with porta_all_group_status first)
0.9.14.2+
porta_start_replStarts the replication on this machine0.9.14.2+
porta_stop_replStops the replication on this machine0.9.14.2+
porta_backup_db• Creates a backup of the Porta database.
• Uses the artisan command
0.9.14.2+
porta_restore_dbRestores the Porta database from a backup0.9.14.2+
porta_reset_db• Resets the Porta database.
• ⚠️ THIS WIPES ALL DATA!
0.9.14.2+
porta_set_bootstrap_ON• Sets the bootstrap flag to ON on this machine.
• ⚠️ This machine will ALWAYS set itself as primary when starting up.
• Useful for single VM setups.
• ⛔ If running multiple Porta VMs in a replication group, DO NOT run this command.
0.9.14.2+
porta_set_bootstrap_OFF• Sets the bootstrap flag to OFF on this machine.
• Causes this machine to NOT set itself as primary when starting up
0.9.14.2+
porta_laravel_logsView logs for Porta0.9.14.2+
porta_laravel_logs_followFollow logs for Porta0.9.14.2+
porta_php_errorsView PHP error logs for Porta0.9.14.2+
porta_php_errors_followFollow PHP error logs for Porta0.9.14.2+
porta_task_logsView Porta task runner logs0.9.14.2+
porta_task_logs_followFollow Porta task runner logs0.9.14.2+
porta_horizon_logsView Porta Horizon queue logs0.9.14.2+
porta_horizon_logs_followFollow Porta Horizon queue logs0.9.14.2+
porta_main_db_logsView Porta database logs (if this is the Main machine)0.9.14.2+
porta_main_db_logs_followFollow Porta database logs (if this is the Main machine)0.9.14.2+
porta_backup_db_logsView Porta database logs (if this is the Backup machine)0.9.14.2+
porta_backup_db_logs_followFollow Porta database logs (if this is the Backup machine)0.9.14.2+
porta_arbiter_db_logsView Porta database logs (if this is the Arbiter machine)0.9.14.2+
porta_arbiter_db_logs_followFollow Porta database logs (if this is the Arbiter machine)0.9.14.2+
porta_db_dumpmysqldump the Porta database.
• Defaults to porta-db and porta database.
• Usage: porta_db_dump [db_container_name] [db_name]
0.9.14.2+
porta_db_restore• Restore database from a mysqldump.
• Defaults to porta-db and porta database.
• Usage: porta_db_restore [db_container_name] [db_name]
• Will prompt the user with a list from the local dumps directory
0.9.14.2+
porta_playout_history• View last 50 items in scheduler playout history.
(if this is the Main machine)
0.9.14.2+
porta_playouts• View last 50 scheduler playouts (includes actively playing and next).
(if this is the Main machine)
0.9.14.2+
porta_backup_playout_history• View last 50 items in scheduler playout history.
(if this is the Backup machine)
0.9.14.2+
porta_backup_playouts• View last 50 scheduler playouts (includes actively playing and next).
(if this is the Backup machine)
0.9.14.2+
porta_arbiter_playout_history• View last 50 items in scheduler playout history.
(if this is the Arbiter machine)
0.9.14.2+
porta_arbiter_playouts• View last 50 scheduler playouts (includes actively playing and next).
(if this is the Arbiter machine)
0.9.14.2+

VM Location: ~/scripts/porta/

ScriptNotesVersions
view-ALL-group-repl-status.sh• View group replication status as reported by each machine in the group.
• ⚠️ Machine IPs must be correct in /etc/hosts
All