1.7 KiB
1.7 KiB
Deployment
What the scripts do
-
scripts/migrate-wordpress.ps1- Dumps the existing WordPress MySQL database to
migration-backups/<timestamp>/wordpress.sql - Copies
wp-content/uploadsout of the legacy WordPress container intostatic/wp-content/uploads - Keeps an archive copy of the uploads in
migration-backups/<timestamp>/uploads
- Dumps the existing WordPress MySQL database to
-
scripts/deploy.ps1- Optionally runs the migration step first
- Optionally shuts down the legacy compose stack
- Validates the new compose file
- Builds and starts the new stack
- Waits for
http://localhost/api/healthto return success
Before cutover
- Fill in
.envfrom.env.example - Make sure the legacy WordPress stack is still running
- Identify:
- the legacy WordPress container name
- the legacy MySQL container name
- the legacy compose file path if you want the deploy script to shut it down for you
- the WordPress MySQL database name, user, and password
Example
powershell -ExecutionPolicy Bypass -File .\scripts\deploy.ps1 `
-RunMigration `
-LegacyComposeFile C:\deploy\wordpress\docker-compose.yml `
-LegacyProjectName goodwalk-wordpress `
-LegacyWordPressContainer goodwalk-wordpress-1 `
-LegacyDatabaseContainer goodwalk-db-1 `
-MySqlDatabase wordpress `
-MySqlUser wordpress `
-MySqlPassword 'replace-me'
Notes
- The new app now uses root-relative
/wp-content/uploads/...paths, so the copied uploads are served by the SvelteKit stack after cutover. - The deployment script does not destroy the legacy database dump. It writes a fresh backup on every migration run.
- If you want to keep the legacy stack running while testing, omit
-LegacyComposeFileor add-SkipLegacyShutdown.