Linux server migration planning
If you run some number of Linux servers for yourself you'll inevitably need to migrate one to a new machine at some point. This might be straightforward, particularly if you can do so by migrating a VM image or if you treat your personal servers like cattle, not pets. If, however, you use your servers like I do, the migration process is not trivial and takes some planning.
This post attempts to index everywhere I check to see what a server is running, plus other stuff to consider when completing the migration. The result can be used to make a migration plan.
What is the server running?
- systemd services
- services running under Docker
- check
tailscale serve status - Let's Encrypt certificates (
/etc/letsencrypt/live) - Nginx websites (
/etc/nginx/sites-enabled) - check
/etc/cron*and user-level crontabs - anything interesting in
/home - anything interesting in
/var/lib(such as Docker, databases, etc) - anything in
/srv - check
netstat -lnptu - check
ufw status - what targets hosted on this machine are your monitoring systems currently monitoring?
- are there other places that you use that aren't covered here? (for example, PM2, or software installed in
/opt?)
I've written a script that indexes most of the stuff listed above. If nothing else, it's a helpful starting point. You can run it directly from the linked Gist via:
curl -s https://gist.githubusercontent.com/cdzombak/dfa620c01bc69f7f419906c3b5c62800/raw/3d3cb09f9935377d22e06964df6243967c4fe503/sysindex.sh | sudo bashOther stuff to remember
- DNS - update for the new server; cleanup old entries
- Reverse DNS - set for the new server
- Monitoring - monitor the new server & services as you stand them up (I use Uptime Kuma for this)
- keep your password manager up to date & tidied as you perform the migration