API Maker

The backend engine for the AI era

Chapters

What you will learn

  • Where Import & Export lives: the three dots of the cards of the Instance API page
  • An export of MongoDB: the program, the form of the file, the options, the job and its log, the zip
  • A collection as JSON with a filter of MongoDB
  • PostgreSQL, MySQL, MariaDB, SQL Server and Oracle, each with its own program
  • An import compared with the database of now: replace, merge, keep or remove each table
  • A copy into a new database, the jobs, and the programs on Sandbox Settings
In the docsImport & Export
Transcript1283 words · click a time to play from there

Intro

Here is import and export, on every database. A table, a database, or a whole instance goes into one file, made by the own program of the database. And a file can be brought back, table by table.

Dumps by hand

Moving data usually means the right version of pg_dump, mysqldump, or SqlPackage on the right machine. You look up the flags of each program again, each time. You type passwords on a command line. And you restore the whole database when only one table was wrong. With API Maker, every card of the Instance API page exports and imports. It uses the own program of the database, installed for you.

Its options each come with help. And an import is compared with the database of now, table by table. In this video: an export of MongoDB, step by step, a collection as JSON, PostgreSQL, MySQL, MariaDB, SQL Server, and Oracle, an import, compared table by table, a copy into a new database, the jobs, and the programs, on Sandbox Settings.

An export, step by step

Open Instance API, then mongodb, and catalog. The three dots of the card of the databases hold Export Database, Import into Database, and the jobs of the instance. The card of the instances has the same for a whole instance. And the card of the collections has it for the ones you select. Click Export Database. At the top is the program that the jobs of this instance run: MongoDB Database Tools, here the one of the server.

Then pick what to export: the whole instance, this database, or some collections. Then the form of the file: the archive of mongodump, with the documents, the indexes, the options, and the views. Below are the options of mongodump, each with its help behind the question mark. Gently runs the job at the lowest priority of the server, so your APIs go first. Click Export. The job runs on the server, and the file is ready.

Its name says the instance, the database, and the time, with its size and its SHA-256. It stays on the server for a day by default. After that, only the job and its log stay. The log says what the program did. mongodump reads its password from its own file, never from the command line. Click Download. The browser downloads it from a link that the server makes for this file, good for fifteen minutes.

In the zip is the archive of mongodump, manifest.json, which describes the database and each collection, and README.txt, with the commands to restore it by hand, without API Maker.

A collection as JSON

One collection works the same way. Pick reviews, and Export Collection. A collection can also go out as JSON or CSV, written by mongoexport. Pick JSON, with a MongoDB filter for the reviews of four stars and more. Click Export, and the reviews are in the file.

PostgreSQL

Now PostgreSQL. Pick postgres, then crm, and Export Database. It uses the PostgreSQL client, installed from its publisher. It makes a dump of pg_dump, restored table by table and in parallel, or a SQL script. Here, the support tickets keep their table, without their rows. Click Export, and the log shows each step of pg_dump.

MySQL

Now MySQL. Pick mysql, then sales, then orders, and Export Table. It uses the MySQL client of the line most compatible with this server, installed the first time. For one table, you can set a condition for its rows, like the delivered orders only. Click Export. You get a script of mysqldump, compressed.

MariaDB

Now MariaDB. Pick mariadb, then marketing, and Export Database. MariaDB publishes no client for a Mac, so the MySQL client works in its place, and the dialog says so. On most Linux servers, it is mariadb-dump. Click Export, and the script is ready.

SQL Server

Now SQL Server. Pick sqlserver, then warehouse, and Export Database. You get a bacpac of SqlPackage, with the schema and the data, or a T-SQL script written by the server itself, with the tables, their rows, and their foreign keys. Microsoft publishes SqlPackage for x86 servers, so on an ARM server, you get the script. Click Export. It is done.

Oracle

Now Oracle. Pick oracle, then the schema HR, and Export Schema. Data Pump runs inside the database itself, so there is no program on the server. It uses one moment: every table as it was when the export started. You can pick a dump that an older Oracle reads, workers, and the directory object. Click Export, and the Data Pump file comes back from the database.

Six engines

Six engines, each with its own program, its own file forms, and its own options. Every file can be restored by hand with that program, without API Maker. Nothing is locked in.

An import, table by table

Now an import. This morning, catalog was exported. Since then, three reviews were deleted by mistake, and a customer wrote a new one. The file of this morning has the three reviews, but not the new one. Click Import into Database. Pick the file of this morning. It is sent at once, in pieces, and read. You see what it holds: an export of the panel, from mongodb, made with mongodump, its size, its SHA-256, and its four collections.

Then it is compared with the database of now. Each collection of the file sits beside the collection of today. reviews changed, because its documents differ. The others are the same. A table can also be new, or exist only now. For each one, you choose. Replace makes the table the same as the file. Merge adds the rows of the file that are not there. Or Keep, or Remove.

Pick nothing, then Merge for reviews. The three lost reviews come back, and the new one stays. Click Import. Say yes. Then each chosen table is counted again. reviews has its three reviews back, and the new one.

A copy into a new database

To look at a file without touching anything, import it into a new database. Take the export of crm, pick it, and import it into crm_review, a new database made by the import. Every table is new, so Everything takes them all. Click Import, say yes, and crm_review sits beside crm.

Jobs and programs

Import & Export Jobs lists every export and import of the instance, newest first, with its file, and until when it stays. Two jobs run at a time on each server, and the others wait for their turn. Tick some, and remove two, with their files, or Clear all. Open Sandbox Settings, and Import & Export Tools. There is one row for each program, with its publisher. You see the versions that your account keeps on every server.

Here, it is an older PostgreSQL client, for the older PostgreSQL of Calm Home. The jobs run it, or Automatic, which is the version most compatible with each database, installed the first time a job needs it. This server says what it runs now, found by itself. And you set how long the files of the jobs stay.

Safe by default

The passwords of the instances never go on a command line. The programs read them from files that only the server can read, removed when the job ends, and hidden in the logs. A download link opens for fifteen minutes. And an import that replaces or removes data asks for the name of the database first.

Recap

To sum up. You export and import from the three dots of every card. The own programs of each database are installed for you. Six engines each have their file forms and options. Imports are compared with the database of now, table by table. And you see the jobs, and the programs on Sandbox Settings. Next: the same exports, on schedules, into S3. API Maker. Build faster, spend smarter, deliver better.