exp:expaccessimport
Import the tables of a Microsoft Access file (.accdb, .mdb) into the site's database or a data table connection.
Script bin/php/expaccessimport.php, code in kernel/private/classes/commands/expaccessimport.php. Run it from the installation root, as the user the web server runs as:
./console exp:expaccessimport --help
./console exp:access:import --help
php bin/php/expaccessimport.php --helpHelp text
Import the tables of a Microsoft Access file into a database of this installation
Reads the file with MDBTools (Linux; read only) or with Microsoft's Access ODBC driver (Windows), makes
the tables in the site's database or in a data table connection (--connection), and copies the rows,
ids and all. Without --apply it shows the tables it would make and does nothing.
./console exp:access:import shop.accdb --list
./console exp:access:import shop.accdb --prefix=shop_
./console exp:access:import shop.accdb --prefix=shop_ --connection=archive --apply
./console exp:access:import shop.mdb --tables=Customers,Orders --mode=replace --apply --format=json
Exit code: 0 done (or planned); 1 a table or row failed; 2 wrong options or an unreadable file.Options
| Option | Value | Help |
|---|---|---|
--list | List the tables of the file with their columns, and stop | |
--apply | Make the tables and copy the rows (without it: show the plan only) | |
--dry-run | Show the plan only (the default) | |
--connection | required | The database to import into: site (the default) or the identifier of a data table connection |
--tables | required | Only these Access tables (a comma list; names as in the file) |
--prefix | required | Put this in front of every table name (lower case letters, digits, ), e.g. shop |
--mode | required | create (the default: new tables only), append (add rows), replace (delete the rows first) |
--reader | required | auto (the default), mdbtools or odbc |
--mdbtools-bin | required | The directory of the MDBTools programs (default: the PATH) |
--driver | required | The ODBC driver for --reader=odbc (default: Microsoft Access Driver (*.mdb, *.accdb)) |
--format | required | text (the default) or json |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [file].
Related
Generated by ./console exp:help:examples from bin/php/expaccessimport.php, kernel/private/classes/commands/expaccessimport.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.