Page MenuHomePhorge

MigrateCommand.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

MigrateCommand.php

<?php
namespace App\Console\Commands\Data;
use App\DataMigrator;
use Illuminate\Console\Command;
/**
* Migrate user data from an external service to Kolab.
*
* Example usage:
*
* ```
* php artisan data:migrate \
* "ews://$user@$server?client_id=$client_id&client_secret=$client_secret&tenant_id=$tenant_id" \
* "dav://$dest_user:$dest_pass@$dest_server"
* ```
*
* Supported account types: ews, dav (davs), imap (tls, ssl, imaps)
*/
class MigrateCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'data:migrate
{src : Source account}
{dst : Destination account}
{--type= : Object type(s)}
{--sync : Execute migration synchronously}
{--force : Force existing queue removal}';
// {--export-only : Only export data}
// {--import-only : Only import previously exported data}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate user data from an external service';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$src = new DataMigrator\Account($this->argument('src'));
$dst = new DataMigrator\Account($this->argument('dst'));
$options = [
'type' => $this->option('type'),
'force' => $this->option('force'),
'sync' => $this->option('sync'),
'stdout' => true,
];
$migrator = new DataMigrator\Engine();
$migrator->migrate($src, $dst, $options);
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 1:29 PM (3 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18851626
Default Alt Text
MigrateCommand.php (1 KB)

Event Timeline