Greetings Andrew,
just an update on this issue. I was able to reassociate the scene layers to its respective feature layers using a tedious workaround, Luckily for me i also had the old portal contents and database directory.
Below are the Steps I did to Reassociate 3D Scene Layers with Feature Layers..
1) Get the OLD SceneLayer Item ID - This is required to copy the missing file contents and metadata
Prepared a CSV with Layer Title, Old Item ID, New Item ID
2) Get the Existing SceneLayer and Related FeatureLayer Item ID
Prepared a CSV with Layer Title, SceneLayer Item ID, FeatureLayer Item ID
3) Updated the reserved__type_keywords in current database as 'Hosted Service' - Done Globally
4) Created a Python Script to Add the Relationship using the csv in #2
feat_item.add_relationship(rel_item= scene_item, rel_type= 'Service2Service')
scene_item.add_relationship(rel_item= feat_item, rel_type= 'Service2Data')
5) Stopped the Portal Service
6) Created a Python script to copy the Contents using csv #1 from Old Backup having old Item ID to Current Contents location with Current Item ID.
Copied all files and folders like metadata, thumbnail and publishParameters.json from old contents to new contents
7) Started the Portal Service
😎 Logged into portal admin and executed the Full Reindex.
Than when i opened the Portal Home page and checked the Scene Layers it were Showing as 'Scene Layer (Hosted)' as opposed to earlier just the 'Scene Layer'. Also within the layers settings page the Manage cache option was now available.
Tested few layers in our end application and the query task etc are now working fine.
I have attached the snapshot of before and after.
Regards,
NileshV