The easiest way would be to deploy a clean CE of the same version you currently have and then once done:
Copy /opt/kaltura/web/content from the old deployment to the new one [be sure to preserve the original file permissions]
Drop the kaltura and kaltura_sphinx_log DBs [no need to drop the DWH DBs, their schemas did not change since 12.20.0] and import them from your original ENV.
Reindex Sphinx with /opt/kaltura/bin/kaltura-sphinx-reindex.sh and make sure it finishes with no errors
When using mysqldump to export the Kaltura DBs, also pass --routines --single-transaction
I believe you said you are currently running 12.20.0 so, following this guide:
Once this is done, test that everything is working as expected and assuming it is, follow the upgrade procedure to upgrade to the latest version [13.7.0],