mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
Enhance migration script with logging and error handling (#2103)
Added logging for migration steps and error handling.
This commit is contained in:
@@ -84,6 +84,21 @@ def migrate_mongo_atlas_vector_to_v1_vectorstore():
|
||||
logger.info("Mongo Atlas migration completed")
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
logger.info("Starting FAISS migration...")
|
||||
migrate_faiss_to_v1_vectorstore()
|
||||
logger.info("FAISS migration completed successfully ")
|
||||
|
||||
logger.info("Starting local Mongo migration...")
|
||||
migrate_to_v1_vectorstore_mongo()
|
||||
logger.info("Local Mongo migration completed successfully ")
|
||||
|
||||
logger.info("Starting Mongo Atlas migration...")
|
||||
migrate_mongo_atlas_vector_to_v1_vectorstore()
|
||||
logger.info("Mongo Atlas migration completed successfully ")
|
||||
|
||||
logger.info(" All migrations completed successfully!")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f" Migration failed due to error: {e}")
|
||||
logger.warning(" Please verify database state or restore from backups if necessary.")
|
||||
|
||||
Reference in New Issue
Block a user