sodcalculator

10 Tech How-To

Migrate Raspberry Pi Services to Mini PC Without Data Loss

Guide 10-21307 · Updated · Step by step

This guide walks you through moving your Raspberry Pi services (like Home Assistant, Pi-hole, or a web server) to a mini PC while keeping all your data, configurations, and settings intact. You’ll learn how to back up, transfer, and restore each service safely, with minimal downtime. Before you start, make sure you have the new mini PC set up with a Linux distribution (Ubuntu Server or Debian recommended) and that both machines are on the same network.

What You’ll Need

  • Your Raspberry Pi (source) and your mini PC (destination) both powered on and connected to the network.
  • SSH access to both machines (or a monitor and keyboard for local access).
  • A USB drive or network storage for backups (optional, but recommended for extra safety).
  • The list of services you’re running on the Pi (check with systemctl list-units --type=service or Docker containers with docker ps).
  • Admin (sudo) privileges on both machines.

Step-by-Step

  1. Inventory your services and data
    SSH into your Pi and list all running services: systemctl list-units --type=service --state=running. For Docker, run docker ps. Note down every service you want to migrate, along with their data directories (e.g., /etc/ for configs, /var/lib/ for databases, or Docker volumes).
  2. Create a full backup on the Pi
    Use tar to archive the important directories. For example, to back up /etc, /var/lib, and /home (adjust to your needs): sudo tar czf /home/pi/backup.tar.gz /etc /var/lib /home/pi. If you use Docker, also export your container list and volumes: docker save -o /home/pi/containers.tar $(docker ps -q) and copy volume data from /var/lib/docker/volumes.
  3. Transfer the backup to the mini PC
    Copy the backup file(s) to the mini PC using scp or rsync. From the Pi: scp /home/pi/backup.tar.gz user@mini-pc-ip:/home/user/. If you have a lot of data, use rsync for resumable transfers: rsync -avz /home/pi/backup.tar.gz user@mini-pc-ip:/home/user/.
  4. Install the same services on the mini PC
    On the mini PC, install the same software packages you had on the Pi. For example, if you ran Home Assistant, install it via the recommended method (e.g., Docker or Python venv). Use your package manager (apt, dnf) to install the dependencies. For Docker containers, load the saved images: docker load -i containers.tar.
  5. Restore configuration files
    Extract the backup on the mini PC: tar xzf backup.tar.gz. Then copy the configuration files to their appropriate locations. For example, if you backed up /etc, you can copy files manually or use rsync to overwrite the defaults: sudo rsync -av /home/user/backup/etc/ /etc/. Be careful not to overwrite system-critical files that differ between architectures; check each file.
  6. Restore data directories
    Copy data directories like databases or Docker volumes. For Docker volumes, copy the contents from the backup into the new volume location (e.g., /var/lib/docker/volumes/). For databases like MariaDB, stop the service, copy the data directory, then start it again.
  7. Adjust service configurations for the new hardware
    Some services may need tweaks for the new architecture (x86 vs ARM). Check for any paths that reference /home/pi or other Pi-specific locations and update them. Also, ensure services that rely on GPIO pins (if any) are removed or adapted, as the mini PC lacks those.
  8. Start services and test
    Enable and start each service on the mini PC: sudo systemctl enable --now service-name. For Docker, run the containers with docker-compose up -d if you used compose files. Test each service by accessing its web interface or API.
  9. Update DNS and port forwarding (if applicable)
    If your services were accessible from outside your network, update your router’s port forwarding rules to point to the mini PC’s IP address. Also update any dynamic DNS entries.
  10. Decommission the Pi (after a grace period)
    Keep the Pi running for a few days to ensure everything works. Once you’re confident, you can shut it down and repurpose it or wipe it.

Common Mistakes

  • Forgetting to back up data directories – Config files are easy, but database files or Docker volumes are often missed. Always check where your service stores its data (e.g., /var/lib/mysql for MariaDB, /var/lib/docker/volumes for Docker).
  • Copying entire system directories blindly – Overwriting /etc from a Pi to a mini PC can break system settings because the hardware and kernel differ. Only copy specific configuration files, not the whole directory.
  • Ignoring architecture differences – Raspberry Pi uses ARM, while most mini PCs use x86. Binary files and some packages are not compatible. Reinstall software from source or use the mini PC’s package manager.
  • Not checking service dependencies – Some services rely on other packages (e.g., Python libraries). Install all dependencies listed in the service’s documentation.
  • Skipping the test phase – Migrating and then immediately shutting down the Pi can leave you in a bind if something isn’t working. Keep the Pi as a fallback until you’re sure.

Tips

  • Use rsync for large data – It’s faster and can resume interrupted transfers. Use --progress to monitor.
  • Label your backups – Include the date and service name in the backup file, e.g., backup-homeassistant-2025-01-15.tar.gz.
  • Write down your service list – Keep a text file with all services, their ports, and data paths. This helps you verify nothing is missed.
  • Test one service at a time – After restoring each service, test it before moving to the next. This isolates problems.
  • Consider using Docker for easier migration – If your services are containerized, you can use docker-compose and volume mounts to make migration nearly plug-and-play in the future.

Troubleshooting

  • Service fails to start – Check the logs: journalctl -u service-name. Look for missing dependencies or file permission errors. If it’s a Python service, ensure the correct Python version is installed.
  • Web interface not loading – Verify the service is listening on the right IP and port: ss -tulpn | grep port. Ensure the firewall on the mini PC allows the port (e.g., sudo ufw allow 8123 for Home Assistant).
  • Database connection errors – If your service uses a database, make sure the database service is running and the credentials are correct. Sometimes the database host is set to localhost but the socket path differs; update the config accordingly.
  • Data appears missing – Double-check that you copied the correct volume or directory. For Docker, use docker inspect container-name to see the volume mounts and ensure they point to the restored data.
  • Permissions issues – Many services run under a specific user. After restoring files, ensure the ownership is correct: sudo chown -R service-user:service-group /path/to/data.

Frequently Asked Questions

Can I just clone the SD card to the mini PC’s hard drive?

No, because the Pi uses an ARM processor, while most mini PCs use x86. The operating system and binaries are not compatible. You need to reinstall the OS and services on the mini PC and then transfer data and configs.

What if I don’t know which services are running?

Use systemctl list-units --type=service --state=running on the Pi to see all active services. Also check for Docker containers with docker ps. You can also check open ports with ss -tulpn to see what’s listening.

Can I use the same SD card in the mini PC?

No, the mini PC likely uses SATA or NVMe drives, not SD cards. Even if it had an SD slot, the architecture difference makes it impossible to boot the Pi’s OS.

How long does the migration take?

It depends on the number of services and data size. A simple setup with a few services can take a couple of hours, while a complex setup with large databases might take a day. The data transfer over network is usually the bottleneck.

Will my IP address change?

Yes, the mini PC will have a different IP address unless you configure a static IP. You’ll need to update any references to the old IP, such as in your router’s port forwarding or client configurations.

Can I keep the Pi running for other tasks?

Absolutely. Once you’ve migrated the services, you can repurpose the Pi for other projects like a retro gaming console or a network ad blocker. Just make sure you remove the old services to free up resources.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →