mardi 6 mai 2014

ASP.net - modification de l'emplacement d'un dossier sans affecter les chemins d'accès stockés dans la base de données - Stack Overflow


I have a folder that stores images and the paths to the images are stored in the database. There are almost 2500+ employee images stored there.


If I want to change the physical location of the folder that has the images, how do I manage the stored paths in the DB and the virtual path, root and all the related info.




Well, here is what I would do:



  1. Copy your images to the new directory. (Leave the old directory in place for now)

  2. Run a SQL update script on your DB to change the stored location. (Without knowing your db structure I can't say more.)

  3. Update your app code to point to the new directory.

  4. Test your app to verify that is uses the new directory.

  5. Rename the old directory to something else, so that any link to it would break.

  6. See if anything is broken, and fix it!



I have a folder that stores images and the paths to the images are stored in the database. There are almost 2500+ employee images stored there.


If I want to change the physical location of the folder that has the images, how do I manage the stored paths in the DB and the virtual path, root and all the related info.



Well, here is what I would do:



  1. Copy your images to the new directory. (Leave the old directory in place for now)

  2. Run a SQL update script on your DB to change the stored location. (Without knowing your db structure I can't say more.)

  3. Update your app code to point to the new directory.

  4. Test your app to verify that is uses the new directory.

  5. Rename the old directory to something else, so that any link to it would break.

  6. See if anything is broken, and fix it!


0 commentaires:

Enregistrer un commentaire