Thank you. Yes, it is a bit awkward. 
I kept and renamed my 7.1 angular directory and properly referenced  
"environment.prod.ts" in the yarn command. I moved the new config.prod.yml 
to it's proper place and ran the " yarn run build:prod" command to build 
the final production version.
I will later delete my old version directories. 

Everything seemed to finish well, although a full system reboot failed to 
start angular as a service. I guess this is my last barrier to a functional 
upgrade, but it is the stuff of a new thread if I need help.
Again - I appreciate the support and am happy to help ring out the new 
version.

On Tuesday, February 8, 2022 at 5:58:07 PM UTC-5 Tim Donohue wrote:

> Hi Chris,
>
> You are 100% correct.  It looks like during 7.2 development, after we 
> created the "yarn env:yaml" script, we then moved some code around, and 
> broke those imports at the top of the old "environment.prod.ts".   So, if 
> you copy it over into the 7.2 directory structure, it won't work because 
> those imports are broken.
>
> Currently, it appears there are two options:
> 1) If your 7.1 folder is separate for the 7.2 folder, you could keep 
> "environment.prod.ts" in the 7.1 directories, and *reference it* from the 
> 7.2 folder.  It'd be a little odd, but look kinda like this. You'd run this 
> from 7.2 root folder.
>
> yarn env:yaml ../../dspace-7.1-old/src/environments/environment.prod.ts 
> config/config.prod.yml
>
> 2) Or, if you want to copy your environment.prod.ts into the 7.2 
> directories first (or don't have the old 7.1 code handy), then do this:
>
> Remove/comment out all 4 existing imports in `environment.prod.ts`.  
> Replace them with these lines at the top of that file. (With those 4 
> imports removed, You need 4 objects, all of which are fully defined below)
>
> interface GlobalConfig { }
>
> enum NotificationAnimationsType {
>     Fade = 'fade',
>     FromTop = 'fromTop',
>     FromRight = 'fromRight',
>     FromBottom = 'fromBottom',
>     FromLeft = 'fromLeft',
>     Rotate = 'rotate',
>     Scale = 'scale'
>   }
>
> enum BrowseByType {
>     Title = 'title',
>     Metadata = 'metadata',
>     Date = 'date'
> }
>
> enum RestRequestMethod {
>     GET = 'GET',
>     POST = 'POST',
>     PUT = 'PUT',
>     DELETE = 'DELETE',
>     OPTIONS = 'OPTIONS',
>     HEAD = 'HEAD',
>     PATCH = 'PATCH'
> }
>
> If you have those imports commented out, and replaced with those lines, 
> then the "environment.prod.ts" can be placed *anywhere* (as it no longer 
> has imports) and the "yarn env:yaml" command can be pointed at it wherever 
> it sits.
>
> I'll get this all moved over into our official docs, as this is obviously 
> more complex then I initially thought...but I'm glad you've helped us 
> discover the issue.
>
> Tim
>
> On Tuesday, February 8, 2022 at 4:18:19 PM UTC-6 Chris Clawson wrote:
>
>> Still doesn't work and I think I know why. The environment.prod.ts file 
>> declares 4 files to import, so the script is unable to find them if  
>> environment.prod.ts is placed in some arbitrary location under the DSpace 
>> 7.2 angular root directory. Shall I presume that these import paths  need 
>> to point to the earlier, DSpace 7.1 files? I guess I may eventually figure 
>> it out. Unless I hear different, I suppose I need to modify 
>> environment.prod.ts to correctly point to these other 4 files:
>> ../config/global-config.interface
>> ../app/shared/notifications/models/notification-animations-type
>> ../app/browse-by/browse-by-switcher/browse-by-decorator
>> ../app/core/data/rest-request-method
>> On Tuesday, February 8, 2022 at 3:54:58 PM UTC-5 Tim Donohue wrote:
>>
>>> Hi Chris,
>>>
>>> It sounds like our the docs need clarifying here.  You need to run `yarn 
>>> env:yaml` from the *NEW 7.2 codebase directory*.  Since you are trying to 
>>> run it from your old 7.1 code, it is throwing an error as that command 
>>> didn't exist in the 7.1 codebase.
>>>
>>> So, the docs were written assuming you were going to essentially install 
>>> 7.2 "on top of" 7.1.  In that situation, you'd have the 7.2 code...but your 
>>> old 7.1 "environment.prod.ts" would still be around (as the update to 7.2 
>>> doesn't delete that file).
>>>
>>> For your purposes, it sounds like your 7.2 code *is in a separate 
>>> directory from 7.1 code*.  So, for your purposes, do this:
>>> 1. Copy the "src/environment/environment.prod.ts" from your 7.1 (old) 
>>> directory, over into the 7.2 (new) directory.  Where you choose to copy it 
>>> into doesn't really matter, but you could put it under "[src-7.2]/config", 
>>> where the configs eventually need to be.
>>> 2. Now, go to [src-7.2] (root 7.2 directory) and run:  "yarn env:yaml 
>>> config/environment.prod.ts config/config.prod.yml".   
>>>
>>> That should be it.  You can then look at that config/config.prod.yml to 
>>> double check it looks correct (the same settings exist in both the YAML and 
>>> TS config files, they just have a different syntax).  Once you are 
>>> satisfied, you can delete the "environment.prod.ts" from your 
>>> [src-7.2]/config/ folder.  It's not used in 7.2 at all.
>>>
>>> Tim
>>>
>>>
>>>
>>> On Tuesday, February 8, 2022 at 12:26:12 PM UTC-6 Chris Clawson wrote:
>>>
>>>> Thanks, Tim, but still frustrated!
>>>> I understand you are saying to go to my old /src/environments 
>>>> directory, and run this command:
>>>> yarn env:yaml environment.prod.ts
>>>> Here is the response I get:
>>>> root@melo4:/opt/dspace-angular-old/src/environments# yarn env:yaml 
>>>> environment.prod.ts
>>>> yarn run v1.22.17
>>>> error Command "env:yaml" not found.
>>>>
>>>> -- embarrassing, did I break something?
>>>> On Tuesday, February 8, 2022 at 12:55:19 PM UTC-5 Tim Donohue wrote:
>>>>
>>>>> Hi Chris,
>>>>>
>>>>> That "yarn env:yaml" command only requires one input, whish is your 
>>>>> old "environment.*.ts" file.  So, that second input is *optional*.  If 
>>>>> you 
>>>>> only give it one input, it'll write the output YAML file into that same 
>>>>> directory.  That's perfectly ok...you'd just want to eventually ensure 
>>>>> that 
>>>>> YAML file gets moved over into 
>>>>> /opt/dspace-angular-dspace/config/config.prod.yml , which is where the UI 
>>>>> will look for your configs in 7.2 (and above).
>>>>>
>>>>> So, I would recommend trying the script with a single input, if the 
>>>>> multiple inputs is getting confusing.
>>>>>
>>>>> If somehow the script is erroring out or not working at all, send the 
>>>>> error message to this list and we'll take a closer look at it.   
>>>>>
>>>>> If worst came to worst, you also can just recreate your configs in 
>>>>> YAML (based on the examples in config.example.yml) ... but, I completely 
>>>>> understand that it's a ton easier to just migrate the settings over.
>>>>>
>>>>> Tim
>>>>>
>>>>> On Tuesday, February 8, 2022 at 9:44:46 AM UTC-6 Chris Clawson wrote:
>>>>>
>>>>>> Upgrading DSpace 7.x (7.1 to 7.2), upgrading the Front-end, step 'C' 
>>>>>> says I should use yarn to convert the earlier installation's .ts files 
>>>>>> to 
>>>>>> .yml. I am not able to get past this step. Perhaps I only need some 
>>>>>> assistance in the specific grammar in using the conversion script.
>>>>>>
>>>>>> The path to my my old DSpace 7.1 angular 'environments' directory
>>>>>>
>>>>>> /opt/dspace-angular-old/src/environments
>>>>>>
>>>>>> My unzipped DSpace 7.2 angular is at:
>>>>>>
>>>>>> /opt/dspace-angular-dspace
>>>>>>
>>>>>> My command prompt is located at /opt/dspace-angular-dspace/config
>>>>>>
>>>>>> Given these conditions, *would someone please provide me* with a 
>>>>>> specific example of how to produce a working command for the this 
>>>>>> documentation example to convert environment.prod.ts
>>>>>>
>>>>>> yarn env:yaml src/environments/environment.prod.ts 
>>>>>> config/config.prod.yml 
>>>>>>
>>>>>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/5636257d-8248-4c38-ad78-ceaba09360f5n%40googlegroups.com.

Reply via email to