Migrating old content to HTTPS
Opencast will not modify already published events. This means that old publications might still use HTTP as protocol if it was used before. Re-processing or re-publishing will update the links but this may not be an option for larger migrations. For that, the following steps might help.
Note that you modify stored data directly without any safety nets usually provided by Opencast. You should understand what you are doing!
- Backup your database, and the Solr and OpenSearch/Elasticsearch indexes.
- OpenSearch/Elasticsearch:
{data}/index
- Solr:
{data}/solr-indexes
- OpenSearch/Elasticsearch:
- Configure Opencast to use HTTPS and test your set-up with a new publication.
- Put all your nodes into maintenance mode or, at least, do not process any videos.
-
Update the media packages:
find . -type f -name "*.xml" -exec \ sed -i 's/http\:\/\/oc-presentation\.example\.com\:80/https:\/\/oc-presentation.example.com/g' {} +
-
Update database tables. Note that Opencast 5 did change the database table name prefix from
mh
tooc
:UPDATE opencast.oc_assets_snapshot SET mediapackage_xml = REPLACE( mediapackage_xml, 'http://oc-presentation.example.com:80', 'https://oc-presentation.example.com') WHERE INSTR( mediapackage_xml, 'http://oc-presentation.example.com:80') > 0; UPDATE opencast.oc_search SET mediapackage_xml = REPLACE( mediapackage_xml, 'http://oc-presentation.example.com:80', 'https://oc-presentation.example.com') WHERE INSTR( mediapackage_xml, 'http://oc-presentation.example.com:80') > 0;
-
Remove the search service's Solr index. It usually is located at
solr-indexes/search
but its location really depends onorg.opencastproject.solr.dir
andorg.opencastproject.search.solr.dir
- Rebuild the Solr indices by re-starting your Opencast node running the search service (usually presentation).
- Rebuild the OpenSearch indices using the REST endpoint listed in the docs: https://admin.opencast.example.com/docs.html?path=/index
Note: If the solr index does not repopulate by itself please check if your nodes are still in maintenance mode and reactivate them.