Migrating Python and Node.js Applications to a New VDS Server

Migration · 19.04.2026
Migrating Python and Node.js Applications to a New VDS Server

For Python: freeze requirements, transfer .env, reinstall. For Node.js: sync without node_modules, npm ci, set up PM2 autostart.

# Python
pip freeze > requirements.txt
rsync -avz /var/www/myapp/ root@new-server:/var/www/myapp/
pip install -r requirements.txt

# Node.js
rsync -avz --exclude=node_modules /var/www/nodeapp/ root@new-server:/var/www/nodeapp/
npm ci && pm2 start app.js --name myapp && pm2 startup && pm2 save
← Back to Knowledge Base Ask Support