Skip to contents

Copies what the "Import from an older atima" page needs out of an atima 2 database (MariaDB or MySQL) into one SQLite file. Run it once, then name the file in the legacy setting of run(). The old database is only read.

Usage

legacy_convert(con, file)

Arguments

con

A DBI connection to the atima 2 database, for example from DBI::dbConnect(RMariaDB::MariaDB(), ...). An account that may only SELECT is enough.

file

The SQLite file to write. It must not exist yet.

Value

file, invisibly. The numbers of accounts, projects and objects copied are reported as messages.

Details

The file holds, for every account with an email address: the email address, the bcrypt hash of the password, and the account's encrypted private key; and for every project that was not deleted: who could open it, and its BIOM file, metadata, taxonomy, tree, name and rarefaction depth, each still encrypted exactly as atima 2 stored it. Nothing is decrypted, so the file is as sensitive as the old database and no more: a project in it can only be read with the password of someone who had access to it. Names, affiliations, sessions, sign-in tokens and cached results are left out. People who could only view a public project of the old site are not listed for it, since everyone had every public project.

Examples

if (FALSE) { # \dontrun{
con <- DBI::dbConnect(
  RMariaDB::MariaDB(),
  dbname = "atima", host = "localhost",
  user = "readonly", password = Sys.getenv("ATIMA2_DB_PASSWORD") )

atima::legacy_convert(con, "atima2.sqlite")
DBI::dbDisconnect(con)

atima::run(auth = "oidc", legacy = c("ATIMA 2" = "atima2.sqlite"))
} # }