Backup-Restore Mopidy

Backup-Restore Mopidy

1. Install Paket Dasar

apt install -y \
python3 \
python3-pip \
python3-venv \
alsa-utils \
gstreamer1.0-tools \
gstreamer1.0-alsa \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
libasound2-plugins \
curl \
wget \
git

Install Iris + Mopidy + TuneIn:

pip3 install Mopidy-Iris --break-system-packages
apt install -y \
mopidy \
mopidy-local \
mopidy-mpd \
mopidy-tunein
mkdir -p /mnt/usb

2. BackUp Script

# =========================================================
# FINAL BACKUP SCRIPT
# Mopidy + CamillaDSP + CamillaGUI + snd-aloop
# =========================================================

mkdir -p /root/audio-backup

# Stop services supaya config konsisten
systemctl stop mopidy
systemctl stop camilladsp
systemctl stop camillagui 2>/dev/null

# Backup utama
tar -czvf /root/audio-backup/master-audio-stack.tar.gz \
/root/camilladsp \
/etc/camilladsp \
/opt/camillagui_backend \
/etc/systemd/system/camilladsp.service \
/etc/systemd/system/camillagui.service \
/etc/modprobe.d/aloop.conf \
/etc/modules-load.d/snd-aloop.conf \
/etc/mopidy \
/usr/local/bin/camilladsp \
/var/lib/mopidy \
/var/cache/mopidy

# Simpan daftar package
dpkg --get-selections > /root/audio-backup/package-list.txt

# Start kembali services
systemctl start camilladsp
systemctl start mopidy
systemctl start camillagui 2>/dev/null

echo "========================================="
echo "BACKUP SELESAI"
echo "File:"
echo "/root/audio-backup/master-audio-stack.tar.gz"
echo "========================================="

3. Restore

# =========================================================
# FINAL RESTORE SCRIPT
# Mopidy + CamillaDSP + CamillaGUI + snd-aloop
# =========================================================

# Stop semua service dulu
systemctl stop mopidy
systemctl stop camilladsp
systemctl stop camillagui 2>/dev/null

# Extract backup
tar -xzvf /root/audio-backup/master-audio-stack.tar.gz -C /

# Permission binary
chmod +x /usr/local/bin/camilladsp
chmod +x /opt/camillagui_backend/camillagui_backend

# Load snd-aloop
modprobe snd-aloop

# Reload systemd
systemctl daemon-reload

# Enable service
systemctl enable camilladsp
systemctl enable mopidy
systemctl enable camillagui

# Reset failed state
systemctl reset-failed

# Start service
systemctl start camilladsp
sleep 3
systemctl start mopidy
systemctl start camillagui

# Status check
echo "========================================="
echo "SERVICE STATUS"
echo "========================================="

systemctl --no-pager --full status camilladsp | head -15
systemctl --no-pager --full status mopidy | head -15
systemctl --no-pager --full status camillagui | head -15

echo "========================================="
echo "ALSA DEVICES"
echo "========================================="

aplay -l
arecord -l

echo "========================================="
echo "RESTORE SELESAI"
echo "========================================="

Setelah restore + reboot, verifikasi:

systemctl status camilladsp
systemctl status mopidy
systemctl status camillagui

Dan test:

http://IP-BOX:5005/gui/index.html
http://IP-BOX:6680/iris/

Kalau semua HIJAU → stack sudah benar-benar plug & play.

Scroll to Top