1. Go to this page and download the library: Download jord-jd/uxdm library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jord-jd / uxdm example snippets
// composer our source and destination objects.
// This example uses database connections, but UXDM supports many different source and destination formats.
$pdoSource = new PDOSource(new PDO('mysql:dbname=old-test;host=localhost', 'un', 'pw'), 'users');
$pdoDestination = new PDODestination(new PDO('mysql:dbname=new-test;host=localhost', 'un', 'pw'), 'new_users');
// Create a new migrator
$migrator = new Migrator;
$migrator->setSource($pdoSource) // Source
->setDestination($pdoDestination) // Destination
->setFieldsToMigrate(['id', 'email', 'name']) // Fields to migrate
->setKeyFields(['id']) // Key(s) used to identify unique rows
->setFieldMap(['name' => 'full_name']) // Mapping of field names, from source to destination
->withProgressBar() // Show progress bar, when run in CLI.
->migrate(); // Do the migration!
$csvSource = new CSVSource('users.csv');
$pdoDestination = new PDODestination(new PDO('mysql:dbname=test-database;host=127.0.0.1', 'root', 'password'), 'users');