源文件:
05-migrate-to-another-vps.md# 05. Migrate to Another VPS
This document explains how to move the Node toolkit to a fresh VPS.
# What can be copied directly
From the generated bundle:
- scripts under
scripts/ - templates under
templates/ - docs under
docs/ - examples for reference
# What must be recreated or adapted
- installed packages (
nginx,certbot,rsync, SELinux tools, etc.) - users/groups (
git,cicd,webread,webwrite) - fnm install for the
gituser - installed Node versions
/etc/sudoers.d/policy- Nginx base config
- systemd daemon reload/enable actions
- DNS and certificates
# Suggested migration order
# 1. Base packages
Install at minimum:
sudo dnf install -y nginx certbot rsync policycoreutils-python-utils curl jq git unzip tar
# 2. Users and groups
Create or align:
gitcicdwebreadwebwrite
Ensure Nginx can read deployed code via webread.
# 3. Install fnm for git
Install fnm into:
/home/git/.local/share/fnm
Then install the required Node versions.
# 4. Copy scripts/templates
Copy exported files from the bundle into:
/usr/local/bin//etc/systemd/system//etc/nginx/snippets//etc/sudoers.d/
Set executable bits and validate syntax.
# 5. Reload system components
sudo systemctl daemon-reload
sudo nginx -t
sudo visudo -c
# 6. Recreate one test site first
Recommended first site:
- a non-critical test domain
- or reproduce
node.v4.sohophp.appas a smoke test
# 7. Validate SELinux
Confirm:
httpd_can_network_connectis enabled- chosen Node ports are labeled
http_port_t - site roots are labeled
httpd_sys_content_t
# 8. Only then migrate production sites
Do not bulk-migrate all sites before one end-to-end test works.
# Recommended portability strategy
Treat this bundle as a reference toolkit, not a full OS image.
The fastest path on a new VPS is:
- install base packages
- copy the bundle
- install scripts/templates
- install fnm + Node versions
- create one test site
- validate
- migrate real repos and domains
# Files to inspect first on a new VPS
docs/01-overview-and-architecture.mddocs/02-script-reference.mddocs/04-cicd-and-sudoers.mdexamples/node.v4.sohophp.app.env.exampleexamples/node.v4.sohophp.app.nginx.conf.example
目录
- 05. Migrate to Another VPS
- What can be copied directly
- What must be recreated or adapted
- Suggested migration order
- 1. Base packages
- 2. Users and groups
- 3. Install fnm for `git`
- 4. Copy scripts/templates
- 5. Reload system components
- 6. Recreate one test site first
- 7. Validate SELinux
- 8. Only then migrate production sites
- Recommended portability strategy
- Files to inspect first on a new VPS