- 15 Aug 2022
- 4 Minutes to read
-
Print
-
DarkLight
-
PDF
HOWTO: Bulk Import Packages using Drop Paths
- Updated on 15 Aug 2022
- 4 Minutes to read
-
Print
-
DarkLight
-
PDF
How To Bulk Import Packages Into A Feed Using A Drop Path
Users of ProGet come to the software with multiple packages ready to be imported – be it from their local drive, a package-hosting service, or an alternative private repository.
It’s entirely possible for you to write a script to publish your package using the feed’s API endpoints, but it’s often easier to bulk-import those packages using a drop path. This ProGet feature configures a feed to use a drop path (a local or network path) that ProGet periodically scans for files to import.
This tutorial will describe how to create a drop-path to easily import packages into your ProGet feeds in bulk quantities. It will also cover some common errors that may occur during the import process and how to resolve them.
If you are looking to migrate packages between two ProGet feeds, please see our migrating a ProGet feed guide.
Step 1: Create a drop-path folder on your server
On your server, navigate to the drive and create a folder for the bulk-import process.
It can be a folder you already have, but for this demonstration we’ll create a new folder and name it “drop-import.” If you are using a folder on a server other than the one ProGet is installed on, you will need use the UNC path of your network shared folder.
The ProGet service account must have full control (read, delete files) over this folder. This step is a good opportunity to configure this permission.
Copy this folder path for later.
Step 2: Navigate to a feed's Storage & Retention
In ProGet, for your desired feed, Navigate Feeds > "MyFeed" > Manage Feed > Storage & Retention.
Step 3: Click on “configure” of the "Drop Path" line item
A pop-up will appear.
Step 4: Type in the folder path
In the "Feed drop path", type or copy/paste the folder path from your server's drive.
Click [Save]
Your feed is now configured to the drop path folder.
After Configuring a Drop Path
You can check on importing packages by navigating to the Packages page of ProGet.
Your feed (or feeds) will populate with packages from the drop-path folder.
You may need to wait a few moments depending on the server power/speed. You can manually refresh to see progress (if necessary).
Troubleshooting
Some warnings or errors may occur during the bulk-import process. You can view these by navigating to the Settings page of ProGet (you’ll need to be logged in as an administrator to view settings).
Warnings or errors are also displayed in the Service Status Service Output window, found in Settings > Manage Service and scrolling down.
Issue: “The Package Already Exists on the Feed”
This warning will display as such in the Server Output window:
This warning means the package already exists in the ProGet feed, so it won’t be imported / installed onto ProGet a second time.
This error will likely appear after the first round of a drop path scan. For example: if ProGet scanned a drop path folder for the first time and then more files were added after the first scan, ProGet will scan a second time, recognize there are files it has already imported/installed, and will skip those files.
There are two ways to resolve this warning.
Option 1: Delete the drop path folder files
Deleting the file from the drop path folder will not delete it from ProGet. ProGet has already imported the data and files onto its server, so the information won't be lost.
You can double-check if a file is still accessible by navigating Feed > Package > Package Version > Files
Option 2: Allow overwriting (not recommended)
Generally, we don’t recommend this method as most developers don’t want to overwrite packages and instead version their packages.
However, if your organization is okay with overwriting packages, you can resolve this warning in the Settings page.
Navigate Settings > Advanced Settings and search for Feeds.AllowDropPathImportOverwrite
Click on the box Allow Drop Path Import Overwrite.
Click [Save Changes] at the bottom of the Advanced Settings page.
Files will now overwrite packages when imported.
This is a global setting and will enable overwriting packages on all feeds configured to use a drop path.
Issue: “An error occurred in the web application: Could not find file …”
This warning may occur if, for some reason, the package was deleted on the drive.
You will see this page if you navigate to the Files tab of the drive-deleted package:
The error will display on the Diagnostic Center like so:
ProGet stores package data on ProGet, but package files on disk. Since ProGet has stored the package data, it may think the package is still present when it isn’t; therefore it won’t import the package to reinstall.
This situation is very unlikely, since it means internal (possibly hidden) files were deleted on disk.
To resolve, delete the package in ProGet.
The drop path configuration will then re-import and reinstall the package.
Issue: "Error deleting imported package..."
This warning will display as such in the Server Output window:
This warning will occur if ProGet does not have permission to read/delete from the drop path folder on the server or network share.
You can resolve this warning by opening the properties of the drop path folder on the server and navigate to the security tab in the pop-up window. Then, Configure your security settings to allow ProGet to have full control on this folder.
Once configured, ProGet will now be able to properly delete a package both in ProGet and on the server.