Deploying MigrationCoordinator to the production server at mc.shareddev.com
| Server | 136.144.128.65 (mc.shareddev.com) |
| SSH User | tmpwork |
| SSH Key | C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key |
| Install Path | /var/www/migrationcoordinator |
| Service | migrationcoordinator (systemd) |
| Runs As | migrationcoordinator user |
| Port | 5002 (behind Nginx with HTTPS) |
| Dashboard | https://mc.shareddev.com |
| Production DB | MigrationCoordinator_prod |
If new migration scripts were added (check database/migrations/), follow these steps before deploying the new code.
0aRefresh the baseline
This takes the current baseline .mdf, applies all pending migration scripts from database/migrations/, assigns a new version number, and generates a deployment script. The migration files are deleted from the server after being consolidated into the new baseline.
0bApply the version SQL to production
Use the newly generated version SQL to update the production database:
All commands are run from your local Windows machine in a terminal (PowerShell, Git Bash, or Claude Code).
1Build for Linux
Compile the project for Linux x64 without bundling the .NET runtime (already installed on the server).
cd C:\Repositories\MigrationSystem
dotnet publish src/MigrationCoordinator/MigrationCoordinator.csproj -c Release -r linux-x64 --self-contained false -o publish_temp
2Prepare server upload folder
Remove any old deploy folder and create a fresh one.
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo rm -rf /tmp/migcoord_deploy && mkdir -p /tmp/migcoord_deploy"
3Upload files to the server
Copy all built files including subdirectories (wwwroot, localization folders).
scp -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" -r C:/Repositories/MigrationSystem/publish_temp/* tmpwork@136.144.128.65:/tmp/migcoord_deploy/
4Stop the service
Stop the running MigrationCoordinator so files can be safely replaced.
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo systemctl stop migrationcoordinator"
5Backup production appsettings.json
The build output includes a default appsettings.json that will overwrite the production config. Save it first.
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo cp /var/www/migrationcoordinator/appsettings.json /tmp/appsettings_backup.json"
6Copy new files to install directory
Replace the application files with the new build. Use -r for subdirectories.
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo cp -r /tmp/migcoord_deploy/* /var/www/migrationcoordinator/"
7Restore production appsettings.json
Put the production config back (connection string, API key, etc.).
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo cp /tmp/appsettings_backup.json /var/www/migrationcoordinator/appsettings.json"
8Fix file ownership
Files were copied as root (via sudo). The service runs as the migrationcoordinator user and needs to own its files.
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo chown -R migrationcoordinator:migrationcoordinator /var/www/migrationcoordinator"
9Start the service
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo systemctl start migrationcoordinator"
10Verify
Check the service is running:
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo systemctl status migrationcoordinator"
Should show active (running). Also check https://mc.shareddev.com in the browser.
11Remove temporary files
Local:
rm -rf C:\Repositories\MigrationSystem\publish_temp
Server:
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo rm -rf /tmp/migcoord_deploy /tmp/appsettings_backup.json"
If something goes wrong after deployment:
# Stop the broken service
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo systemctl stop migrationcoordinator"
# Restore from backup (if you made one before deploying)
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo cp -r /var/www/migrationcoordinator_backup/* /var/www/migrationcoordinator/"
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo chown -R migrationcoordinator:migrationcoordinator /var/www/migrationcoordinator"
# Start the old version
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo systemctl start migrationcoordinator"
ssh ... "sudo cp -r /var/www/migrationcoordinator /var/www/migrationcoordinator_backup"For experienced users, steps 4–9 can be combined into a single SSH command:
ssh -i "C:\Repositories\SharedDev\ISO27001\Apps\tmp\tmpwork_key" tmpwork@136.144.128.65 "sudo systemctl stop migrationcoordinator && sudo cp /var/www/migrationcoordinator/appsettings.json /tmp/appsettings_backup.json && sudo cp -r /tmp/migcoord_deploy/* /var/www/migrationcoordinator/ && sudo cp /tmp/appsettings_backup.json /var/www/migrationcoordinator/appsettings.json && sudo chown -R migrationcoordinator:migrationcoordinator /var/www/migrationcoordinator && sudo systemctl start migrationcoordinator"
| Action | Command |
|---|---|
| View logs | ssh ... "sudo journalctl -u migrationcoordinator -f" |
| Check status | ssh ... "sudo systemctl status migrationcoordinator" |
| Restart service | ssh ... "sudo systemctl restart migrationcoordinator" |
| View service config | ssh ... "sudo systemctl cat migrationcoordinator" |
| View production config | ssh ... "sudo cat /var/www/migrationcoordinator/appsettings.json" |
MigrationCoordinator — Deployment Guide — Last updated March 2026