This is the legacy ITS Confluence server. All content has been migrated to the new server located at:
For questions, please email atlassiansupport@virginia.edu
This is the legacy ITS Confluence server. All content has been migrated to the new server located at:
For questions, please email atlassiansupport@virginia.edu
Table of Contents | ||
---|---|---|
|
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
If you have already completed the installation steps below and are just trying to run the importer, follow the steps below. Otherwise skip ahead to "What You'll Need" and proceed from there.
|
First:
Then:
Also:
Info |
---|
If you're completely new to using python or the command line, these instructions assume you're working on MacOS. |
...
...
Info | ||||
---|---|---|---|---|
| ||||
The password you created. |
Final result: A KEY and VALUE
...
Info | ||||
---|---|---|---|---|
| ||||
The KEY and VALUE |
...
you got in step 5. |
Final result: python, pip, and brew installed on your computer
...
The terminal may ask you to hit Return again to confirm the installation, then will request your Mac password. Enter it, then hit Return one last time.
First, we'll check if you already have the right version of Python. Copy and paste the following code into the terminal, then press Return.
Code Block |
---|
python --version |
Info |
---|
If the terminal says you're using python 3 or higher, you can skip to the next section. |
Code Block |
---|
brew install python |
if that doesn't work, try:
...
You should see the version of pip that's been installed.
Final result: These packages installed onto your computer
...
Run the following :
Code Block |
---|
pip install virtualenv |
...
Run the following:
Code Block |
---|
pipbrew install virtualenvwrapperimagemagick |
...
Run the following:
Code Block |
---|
brew install imagemagickdcraw |
...
Run the following:
Code Block |
---|
brew install exiftool |
Then:
Code Block |
---|
pip install dcrawpyexifinfo |
Using the Terminal, you can create and move into 'directories'. This is just creating and moving into folders on your computer using the command line. For simplicity's sake, we're going to create a folder directly in your documents called bhutan-import.
...
If you open up Finder, you'll see there's a folder called 'bhutan-import' in your Documents.
Run this code to clone the importation code into bhutan-import.
...
A folder called mandala-bii will show up in bhutan-import once the code is cloned.
If your images have embedded metadata generated with Adobe Bridge, skip to the next step (7). If the images were managed using Mediap Pro, contact Veronica KuhnContact Sam Chrisinger, who will link you to an .xml file from Box. Download the file.
Put the downloaded file , then put it inside the mandala-bii folder that you created in the previous step. You can use the good ol' click and drag method, no need to use the Terminal! Save the file name for later.
Info | ||
---|---|---|
| ||
That .xml file really needs to be inside the mandala-bii folder, otherwise your importation command won't work! |
Info | ||||
---|---|---|---|---|
| ||||
The name of the xml file you downloaded. |
Back in the Terminal, run:
...
Code Block |
---|
source venv/bin/activate |
If you've done this correctly, you should see (VENV NAME) at the beginning of the bash prompt.
Enter the mandala-bii directory by running the following:
...
Code Block |
---|
pip install -r requirements.txt |
In Mandala, create a collection or subcollection to house the images you're importing. As you do this, check the URL in the collections editor. This lets you find the collection id, which you'll need to direct the import to that collection. For example, for the Chuma Laptse collection, I can go into the editor and see the URL is https://images.shanti.virginia.edu/node/1419391/edit, so the collection id is 1419391.
Info | ||||
---|---|---|---|---|
| ||||
The collection id. |
Use the following code, with some substitutions:
Code Block | ||
---|---|---|
| ||
python import.py -s Encoded -c KEY=VALUE -i "/IMAGE/FILE/PATH" -u https://images.shanti.virginia.edu/admin/content/bulk_image_import/api -v -cid COLLECTION_ID -cv -cw ImageMagick --ftp --ftp_user YOUR_BOX_USER --ftp_pass YOUR_BOX_PASS |
Use the following code, with some substitutions:
Code Block | ||
---|---|---|
| ||
python import.py -s MediaPro -x "XML File Name_FILE_NAME.xml" -c KEY=VALUE -i "/Image UploadsIMAGE/Bhutan/Bhutan Year X/XML File NameFILE/PATH" -u https://images.shanti.virginia.edu/admin/content/bulk_image_import/api -v -cid 619101COLLECTION_ID -cv -cw ImageMagick --ftp --ftp_user YOUR_BOX_USER --ftp_pass YOUR_BOX_PASS |
...
You can ignore any other messages as long as the importation is still running. Any imported images should be immediately visible at at your collection on Mandala.
Sometimes an image is imported incorrectly during importation. This can occur because of an issue with converting the image, or for other reasons. The importer script provides a way to selectively re-upload or "repair" an already imported image. Use the steps below to do so:
Get a list of the images you want to repair- you will need a CSV file with an entry containing the node id, task id, and filename for all of the images. The easiest way to get this list for a catalog is to:
Log in to Acquia Cloud and visit the detail page for the Prod environment (https://cloud.acquia.com/app/develop/applications/14584a7f-64a0-4816-ad7f-b1d9a6da429a/environments/23134-14584a7f-64a0-4816-ad7f-b1d9a6da429a)
Copy the "SSH URL" to your clipboard, and from a terminal run:
Code Block |
---|
ssh SSH URL |
replacing SSH URL with your clipboard contents.
Run:
Code Block |
---|
cd /var/www/html/shanti.prod/docroot/sites/images/ |
You are about to run some commands in MySQL. Please proceed with caution. Updates and deletes are committed to the Production database immediately.
To find your catalog name run:
Code Block |
---|
drush sqlq "select distinct(catalog) from bulk_image_import_task;" |
Then run:
Code Block |
---|
drush sqlq "select node_id, tid, filename from bulk_image_import_task where catalog = 'YOUR CATALOG NAME';" > /home/shanti/import.tsv |
Enter CTRL-d to exit the SSH session
To copy the file down locally, run:
Code Block |
---|
scp shanti.prod@ded-18858.prod.hosting.acquia.com:/home/shanti/import.tsv ~/Downloads/import.tsv |
Then run:
Code Block |
---|
cat ~/Downloads/import.tsv | tr "\\t" "," > ~/Downloads/import.csv |
You now have a file (import.csv) that contains a list of node id, task ids, and filenames for each entry in your catalog. You can now run the importer's repair script:
Code Block |
---|
python import.py -s Repair --csv "import.csv" -c COOKIE=VAL -i "PATH TO IMAGES FOLDER" -u https://images.shanti.virginia.edu |
...
/admin/content/bulk_image_import/api -v --ftp --ftp_user YOUR USERNAME --ftp_pass 'XXXXXX' -cv -cw ImageMagick
|