The main task of this migration was to move a server running MCSManager from one Debian server to another new Debian server. Specifically, it involved the following:
- Minecraft Server: Includes three server instances:
- Velocity proxy server
- Purpur login server
- Leaves survival server
- Bot Services:
- Bots based on Nonebot / Koishi framework using the OneBot v11 protocol
- Bots using the official QQ interface
The new server was also optimized, including installing the 1Panel panel, setting up Zsh terminal, and introducing the plugin manager Zinit.
This migration was not just a replication of the basic environment but also an iteration of the technology stack~
Data Migration
Using rsync to Improve Transfer Efficiency
During the migration, I initially tried using scp for data transfer, but found the transfer speed unsatisfactory. Therefore, I switched to rsync, which supports incremental synchronization and displays transfer progress, while also performing better in terms of efficiency and flexibility.
-a: Archive mode, preserves file permissions, timestamps, and other metadata.-v: Verbose output.-z: Compress data during transfer.--progress: Display transfer progress.--exclude="Config/": Exclude specific directories.
With this command, I achieved data synchronization from the old server to the new server, with the entire process being stable and efficient. Additionally, rsync's incremental update feature is ideal for scenarios requiring multiple migration debugging attempts, significantly reducing the transfer time of duplicate data.
1Panel Installation and Usage
What is 1Panel
1Panel is a modern open-source Linux operations management panel designed to improve server management efficiency by simplifying operations. It offers the following main advantages:
- Efficient Management: Achieve host monitoring, file management, database management, and other functions through a web graphical interface.
- Quick Site Building: Deeply integrated with open-source site-building tools such as WordPress and Halo, supporting one-click domain binding and SSL configuration.
- App Store: Provides a wealth of high-quality open-source tools and application software, allowing users to quickly install and upgrade.
- Secure and Reliable: Built-in firewall and log auditing features enhance system security, while container technology reduces vulnerability exposure.
- One-Click Backup: Supports backup to local or cloud, easily ensuring data security.
Installation Steps
The installation process for 1Panel is very simple; just use the following command:
Migration
- MariaDB
- phpMyAdmin
- Koishi
- Qinglong
- DDNS-Go
- Uptime-Kuma
- Alist
- Redis
The migration of these is particularly simple; it's just a matter of using rsync to transfer the contents of /opt/1panel/apps one by one.
If you're really lazy, it's recommended to directly migrate the entire /opt/1panel directory over. Tested to be feasible (
If you're interested in any of these migrations, please leave a comment, and maybe I'll write another article about it.
Zsh Terminal Configuration
Why Zinit
When configuring the terminal for the new server, I chose Zinit as the Zsh plugin manager instead of the common Oh My Zsh. The reason is Zinit's lightweight nature and high performance. Compared to Oh My Zsh, Zinit loads plugins faster and does not affect terminal startup time.
Zinit can be understood as the 'vim-plug' for Zsh, while Oh My Zsh is more like a complete framework (similar to SpaceVim). This lightweight nature allows me to flexibly customize the terminal environment as needed without introducing additional redundant features.
Installing Zsh
First, I installed Zsh using the following command:
Installing Zinit
Next, I ran the following command to install Zinit:
After installation, I added the following configuration to the .zshrc file to load commonly used plugins (just add them! They will be downloaded automatically):
Detailed Explanation of Plugin Functions
zsh-users/zsh-completions: Extends Zsh's auto-completion capabilities, supporting advanced completion for common tools (such asgit,docker), improving input efficiency.zsh-users/zsh-autosuggestions: Provides real-time command suggestions based on history and context, reducing repetitive input.zsh-users/zsh-history-substring-search: Supports quick search of historical commands by substring, combined with key binding for more convenient history querying.zdharma-continuum/fast-syntax-highlighting: Implements command syntax highlighting; incorrect commands are highlighted in red, correct commands in green, helping to quickly identify input errors.romkatv/powerlevel10k: A high-performance terminal theme that provides rich visual effects and information display (such as Git status, network status, etc.), and loads extremely fast.OMZ::lib/completion.zsh: Enhances Zsh auto-completion, working together withzsh-completions.OMZ::lib/history.zsh: Optimizes Zsh history management, supporting persistence and quick recall.OMZ::lib/key-bindings.zsh: Provides more intuitive key binding features to enhance terminal interaction.OMZ::lib/theme-and-appearance.zsh: Controls Zsh theme and appearance settings; works best with Powerlevel10k.djui/alias-tips: Provides alias tips; for example, when enteringgit status, it prompts the defined alias (such asgst).
Installing x-cmd Tool
x-cmd Introduction
After completing the migration, I also tried installing the x-cmd tool. It is a lightweight tool written in POSIX Shell, with the following features:
- No root privileges required: Comes with a package manager and can run without superuser privileges.
- Modular design: Code is organized in modules (mod), offering high flexibility.
- Out-of-the-box: Simple installation, ready for various operations scenarios.
Installation Steps
The command to install x-cmd is as follows:
x-cmd's package management feature allows me to easily install some standalone tools without relying on system-level package managers or anything else. It's just great to use!