Data migration between two servers on which kaltura is installed

Hi,

I have installed kaltura on two different servers which are located geographically at different places. Both servers will be used by two group of people. They would upload their own videos. Now i have a task where i have to copy the data of one server into another so that information on both servers remain common.
Please suggest me the best method available for data migration, also provide me with detailed information on tables that needs to be updated on kaltura database

Hello,

I am not quite sure whether you want the two instances to just share the same data or only do a one time sync and then let them operate indep.
If the first, then what we’re actually talking about is a Kaltura cluster. Sharing the assets [entry files, players, KMC, etc] over NFS and using the same DB. For that, look at:


or:

If it is just a one time sync, start by looking at:

Note that it is critical that both instances, the original and new, run the same Kaltura version.

Hi Jess,

Thanks for your response. As per your suggestions, i would like to try one time sync. Followed the link provided. I have doubt regarding the API file that needs to be created for downloading video from one server.

Need two clarifications :-

  1. I would like to know the location on server to run this script file. Is it in /opt/kaltura/ or somewhere else.
  2. Which tables in database will provide me information the input value required for running the download API script.

Souds silly, but really require your help to resolve this as my task completion date has arrived now.

that script can run from anywhere in the file system since it uses an absolute path to /opt/kaltura/web/content/clientlibs/php5/KalturaClient.php. But that only downloads the source assets.

To get the admin_secret for your partner:
mysql> select admin_secret from partner where id=$YOUR_PARTNER;

Note however that when you reingest these entries onto the new system, they will be assigned different IDs. Don’t know if that matters to you or not.

If you want a complete clone of your existing system on a new machine, you can just use /opt/kaltura/bin/kaltura-export-db.sh to export all the Kaltura DBs, then edit the resulting SQL and replace the old hostname with the new one and import it to the new system’s MySQL and copy over all the assets under /opt/kaltura/web/content/ onto the new system.

Make sure the new system has the same Kaltura version as the old one though, cause otherwise, it will not work.

Hi jess,

First of all thanks for earlier help. As per your instruction i did the following on my server machine

  1. Created a script file named Migration.php under /var/www/html.
  2. Copied contents provided from URL Copy videos between servers with different versions of kaltura to the Migration.php file.
    3.executed command “php -F Migration.php partner_id admin_secret service_url” where parameters included the following values -
    partner = 500
    admin_secret = ds98wd33sdfd6f9473e6425aa77fjkdhdhf8484
    service_url = http://ip-address/start

Please confirm parameters provided are correct format ?
What would be the output of the aboe executed command ?

Hello,

Most welcome.
Please mask your admin secret from the post. Never a good idea to share these.
Output should be a list of direct URLs for downloading the media.

hi ,

Thanks for the reply. just a quick question . How much time does it take generate the output . Because i waited for half hour to get an output but it was blank , So filnally i did ctrl+C to stop the command execution.

Regards

Your service URL is wrong:
service_url = http://ip-address/start
Should not include "/start"
It should start outputting URLs rather quickly. Time it takes to conclude depends on how many entries they are…
If you’ve been waiting for half an hour and got nothing, something is wrong.

Hi Jess,

Not showing any result. I will paste the code which i am trying to use. What all things should i check on my server to make this script run successfully. It gives me the text available in echo function but does not show any URL in the output console. Please suggest.

#!/usr/bin/php

<?php echo "Hello Jay!"; if ($argc < 4){ echo "\nUsage: ".$argv[0] . ' '."\n\n"; exit (1); } require_once('/opt/kaltura/web/content/clientlibs/php5/KalturaClient.php'); $userId = null; $expiry = null; $privileges = null; $partnerId=$argv[1]; $secret = $argv[2]; $type = KalturaSessionType::ADMIN; $config = new KalturaConfiguration($partnerId); $config->serviceUrl = $argv[3]; $client = new KalturaClient($config); $ks = $client->session->start($secret, $userId, $type, $partnerId, $expiry, $privileges); $client->setKs($ks); $filter=null; $total_media_entries = $client->media->count($filter); $pager = new KalturaFilterPager(); $page_index=1; $pager->pageSize = 500; $processed_entries=0; echo "Hello Prince!"; while ($processed_entries < $total_media_entries){ $pager->pageIndex=$page_index; $result = $client->media->listAction($filter, $pager); foreach ($result->objects as $entry) { $filter = new KalturaAssetFilter(); echo "heloo loop"; $filter->entryIdEqual = $entry->id; $filter->tagsLike = 'source'; $pager = null; $result = $client->flavorAsset->listAction($filter, $pager); if(isset($result->objects[0]->id)){ $result = $client->flavorAsset->geturl($result->objects[0]->id, null, null, null); } if(is_string($result)){ echo ( $result."\n"); } $processed_entries++; } $page_index++; } ?>

Any Updates Jess. Looking forward to your support

Hi @jess , I have a similar situation, where I have kaltura 16.14 installed on one of my servers running on RHEL 7, and now I have started another server on RHEL 8 and installed kaltura 16.14.

I want to completely clone the existing data so, here’s what I have done so far:

  1. Replaced the contents /opt/kaltura/web/content folder in RHEL 8, with the contents of RHEL 7
  2. Updated value of host_name and url in kaltura.delivery_profile
  3. because my database is hosted on a seperate server so i skipped the /opt/kaltura/bin/kaltura-export-db.sh (still want to know where exactly do i need to update the host in SQL)
  4. ran /opt/kaltura/bin/kaltura-config-all.sh

I get the following error,

failed to unserialize server result
PHP Class map could not be loadedRunning Sphinx config..

Then on observing the kaltlog I found this

PHP Fatal error:  Uncaught Zend_Config_Exception: Section 'ip-172-31-27-144.ap-southeast-1.compute.internal' cannot be found in /opt/kaltura/app/cache//batch/config.ini in /opt/kaltura/app/vendor/ZendFramework/library/Zend/Config/Ini.php:150
Stack trace:
#0 /opt/kaltura/app/batch/scheduler/KSchedulerConfig.class.php(129): Zend_Config_Ini->__construct()

Upon checking /opt/kaltura/app/cache//batch/config.ini, I could not find any difference in RHEL 7 and RHEL 8 servers code.

Please help