-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrate_paths.py
More file actions
33 lines (26 loc) · 834 Bytes
/
migrate_paths.py
File metadata and controls
33 lines (26 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
"""
Filesystem migration script.
This script performs best-effort migration of legacy directory paths (e.g. moving uploads
from root to data/uploads). It should be run once during deployment or upgrade.
"""
import sys
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent.resolve()
sys.path.insert(0, str(project_root))
try:
from app.core.config import migrate_legacy_paths
except ImportError as e:
print(f"❌ Error importing app configuration: {e}")
sys.exit(1)
def main():
print("Starting legacy path migration...")
try:
migrate_legacy_paths(force=True)
print("✅ Migration completed successfully.")
except Exception as e:
print(f"❌ Migration failed: {e}")
sys.exit(1)
if __name__ == "__main__":
main()