Copy videos between servers with different versions of kaltura


We have two servers with kaltura

SERVER 1: Community Edition 10.10.0
NEW SERVER 2: fresh install of Community Edition 10.21.0.

Is it possible copy videos between those servers?


Are you only interested in moving the videos over or all data? i.e partners, metadata, etc?
If you want to move the whole data, copying over /opt/kaltura/web/ to the new server, while preserving permissions, as well as exporting all the Kaltura DBs [you can use /opt/kaltura/bin/ for that] will do it.
Note that if the hostname on the new server is different, you should replace the old service URL with the new one in the dumped SQL before importing it back.

If you are only interested in importing the videos themselves, the easiest way would probably be to get the download URL for each video using the API and then use bulk upload on the new server to import them in.

Bulk upload file examples are available from the KMC->upload menu.

to get the URLs for existing media files, you can use:

if ($argc < 4){
    echo "\nUsage: ".$argv[0] . ' <partner id> <admin secret> <service url>'."\n\n";
    exit (1);
$userId = null;
$expiry = null;
$privileges = null;
$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);
$total_media_entries = $client->media->count($filter);
$pager = new KalturaFilterPager();
$pager->pageSize = 500;

while ($processed_entries < $total_media_entries){
    $result = $client->media->listAction($filter, $pager);
        foreach ($result->objects as $entry) {
            $filter = new KalturaAssetFilter();
            $filter->entryIdEqual = $entry->id;
            $filter->tagsLike = 'source';
            $pager = null;
            $result = $client->flavorAsset->listAction($filter, $pager);
                $result = $client->flavorAsset->geturl($result->objects[0]->id, null, null, null);
                echo ( $result."\n");

Exactly what I need. Tks a lot!

After copying content of /opt/kaltura/web, follow these steps:

  1. I made a dump of the Kaltura database tables;
  2. Ran a commands:
    sed -i ‘s/’ Dump20151022.sql
    sed -i ‘s/old_hostname/new_hostname/g’ Dump20151022.sql
    mysql -u root -p -h < Dump20151022.sql

When I enter the system, by clicking CONTENT appears the error “Internal database error”.

Is there anything else what I have to do?

My guess would be you did not copy /opt/kaltura/web with the proper permissions:)
You can re-run the config scripts to set them.
After making sure the perms are correct, run:
# kaltlog
from the server’s shell in parallel to making the request and look for errors outputted to STDOUT.

In addition, use an HTTP sniffer [like the dev tools in your browser] to look for failing requests.

I set permissions and run config again…


That’s not enough information, I’m afraid. Did you make sure the file permissions are correct?
Also, look at /opt/kaltura/log/kaltura_api_v3.log and track down what’s causing the issue.

When I copied files, i used rsync with -a option like down:

rsync -avzP /opt/kaltura/web/

So, I believe that the permissions are right.

What kind of information I need to find in kaltura_api_v3.log?

The logs should include errors and exceptions.
Check for this pattern “ERR:|PHP|trace|CRIT|[error]” in the log and then look at the lines before the error to understand how the code flow got there.

Feel free to post your findings here so I can help you analyse them.

Hi! Follow the file…
Tks for your help…

Another piece of file…


You’re problem starts here:
‘Exception’ with message ‘SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘metadata_profile.FILE_SYNC_VERSION’ in ‘field list’’ in /opt/kaltura/app/infra/log/KalturaLog.php:83

This indicates that the old server and they new one do not run the same exact Kaltura version and the schemas are different.

What is the output for:
# rpm -q kaltura-base
on each machine?

Old server: kaltura-base-10.10.0-3.noarch
New server: kaltura-base-10.21.0-11.noarch

Right. So, this is the problem.
You can fix it by installing the new server with version kaltura-base-10.10.0-3 which you can do if you set the repos to be:
baseurl =$basearch/
in /etc/yum.repos.d/kaltura.repo

Import the data as before, including running:
to reindex the Sphinx.

and then upgrade the server to latest as normal.

Another way is to upgrade the old server to latest and then reimport the data to the new server.


I Updated the old server and import to new server with sucess.

Tks for reply!


Hi Senger,

Great, glad all is well:)
Happy Kalturing,

BTW, would love for you to participate in our survey here:

We will raffle 10 complete Rasperry Pi Kits and a 12 months sponsored account among the participants who completed the survey.