You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04 TLS升级至最新版本及备份方案咨询

Ubuntu 20.04 TLS升级至最新版本及备份方案咨询

Hey there! Let's walk through this step by step to make sure your upgrade goes smoothly without losing any data or breaking your TeamSpeak and SinusBot setups. I'll break this into backup strategies first (super important!), then the upgrade process, and finally verifying everything works post-upgrade.

第一步:做好万全备份(两种方案可选)

You're right—backing up is non-negotiable here. Let's cover two reliable methods:

文件级备份(针对关键服务数据)

This targets exactly the data and configs you care about, without backing up the entire system. First, confirm your TeamSpeak and SinusBot install paths (common defaults are /opt/ts3server and /opt/sinusbot, but double-check if you used custom directories):

  • Backup TeamSpeak:

    sudo tar -czvf ts3_backup_$(date +%Y%m%d).tar.gz /opt/ts3server
    

    This creates a timestamped compressed archive, making it easy to track when the backup was created.

  • Backup SinusBot:

    sudo tar -czvf sinusbot_backup_$(date +%Y%m%d).tar.gz /opt/sinusbot
    
  • Backup system-level configs:
    If you modified firewall rules, cron jobs, or network settings, back those up too:

    sudo tar -czvf system_configs_backup_$(date +%Y%m%d).tar.gz /etc/ufw /etc/crontab /etc/netplan
    
  • Store backups safely:
    Copy these archives to an external drive, remote server (use scp), or cloud storage—never leave backups only on the VPS you're upgrading!

系统级镜像备份(完整系统恢复)

If you want a full "safety net" to restore the entire server if something goes wrong, use dd (note: this can be slow for large disks, but it's thorough):

  1. Ensure you have an external storage device mounted (like a block storage volume attached to your VPS)
  2. Run the backup command:
    sudo dd if=/dev/sda of=/path/to/external/storage/ubuntu_2004_backup.img bs=4M status=progress
    
    Replace /dev/sda with your main disk (check with lsblk if unsure) and the output path to your external storage.

第二步:准备并执行系统升级

Before jumping into the upgrade, let's make sure your current system is fully up-to-date:

  1. Update all existing packages:

    sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y
    

    This ensures you're starting with the latest patches for 20.04, reducing upgrade conflicts.

  2. Install the upgrade tool:
    If it's not already installed, grab update-manager-core:

    sudo apt install update-manager-core -y
    
  3. Choose your target version:

    • To upgrade to 22.04 LTS (recommended for server stability):
      Edit the release-upgrades config file:

      sudo nano /etc/update-manager/release-upgrades
      

      Ensure Prompt=lts is set (this is the default for LTS systems).

    • To upgrade to 22.10 (non-LTS, newer features but shorter support):
      Change Prompt=lts to Prompt=normal in the same file.

  4. Stop your services temporarily:
    To prevent data corruption during the upgrade, shut down TeamSpeak and SinusBot:

    sudo systemctl stop ts3server
    sudo systemctl stop sinusbot
    
  5. Run the upgrade:

    sudo do-release-upgrade
    

    Follow on-screen prompts carefully:

    • When asked about replacing configuration files, always choose "keep the local version currently installed" if you modified any files (like TeamSpeak/SinusBot configs or system settings). This preserves your customizations.
    • Don't interrupt the process—it will take some time to complete.
  6. Reboot when prompted:
    Once the upgrade finishes, restart your server to apply all changes:

    sudo reboot
    

第三步:升级后验证服务正常运行

After rebooting, let's confirm everything works as expected:

  1. Start your services:

    sudo systemctl start ts3server
    sudo systemctl start sinusbot
    
  2. Verify service status:
    Check if they're running without errors:

    sudo systemctl status ts3server
    sudo systemctl status sinusbot
    

    If either service fails to start, check logs for clues:

    journalctl -u ts3server -f
    journalctl -u sinusbot -f
    
  3. Test functionality:
    Connect to your TeamSpeak server to confirm voice chat works, and check if SinusBot responds to commands. If you hit dependency issues (e.g., missing libraries for SinusBot), you may need to reinstall its dependencies using official SinusBot steps for Ubuntu 22.04/22.10.

  4. Final system check:
    Ensure all packages are up-to-date on the new version:

    sudo apt update && sudo apt upgrade -y
    

That's it! By following these steps, you should have a smooth upgrade with all your data and configurations intact. If you hit any snags, let us know and we can troubleshoot further.

备注:内容来源于stack exchange,提问作者user1705672

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 10:58:04