diff --git a/TODO.md b/TODO.md index 5ab86e4..a4d3751 100644 --- a/TODO.md +++ b/TODO.md @@ -50,6 +50,8 @@ - [x] Replace all remaining "Post-ERG" branding with "XAMXAM" (scripts, PHP source, schema, docs) - [x] `deploy-server.sh`: remove legacy `sites-enabled/posterg` symlink to fix duplicate `limit_req_zone` nginx error - [x] `deploy-server.sh`: auto-migrate `.htpasswd-posterg` → `.htpasswd-xamxam` if new file absent +- [x] `deploy-server.sh`: auto-migrate `posterg.db` → `xamxam.db` if new DB missing/empty; remove legacy file +- [x] `deploy-server.sh`: clean up legacy posterg nginx configs and prune old backups - [x] Rename local `storage/posterg.db` → `storage/xamxam.db` ## LDAP auth migration (pending client access) diff --git a/scripts/deploy-server.sh b/scripts/deploy-server.sh index 3b0715b..74b26a7 100755 --- a/scripts/deploy-server.sh +++ b/scripts/deploy-server.sh @@ -42,6 +42,16 @@ if [ -d "/var/www/xamxam/storage" ]; then ok "Storage: 2775, databases: 660" fi +# Migrate posterg.db → xamxam.db if the new name is missing or empty +if [ -f "/var/www/xamxam/storage/posterg.db" ]; then + if [ ! -s "/var/www/xamxam/storage/xamxam.db" ]; then + cp /var/www/xamxam/storage/posterg.db /var/www/xamxam/storage/xamxam.db + ok "Migrated posterg.db → xamxam.db" + fi + rm /var/www/xamxam/storage/posterg.db + ok "Removed legacy posterg.db" +fi + # Ensure writable cache subdirectories exist for php-fpm (www-data) mkdir -p /var/www/xamxam/storage/cache/rate_limit chown -R www-data:xamxam /var/www/xamxam/storage/cache