Rust

transfer

Module

The transfer: runs a source into a destination, and reports on it.

Contents

1 submodule, and what the module defines itself.

use utopia_migration::transfer::ReportEntry;
Rust
pub struct ReportEntry

One line of Transfer::report.

use utopia_migration::ResourceSelector;
Rust
pub struct ResourceSelector

A resource named by Appwrite's canonical relation fields: the resource and, for a child (a table of a database), its parent.

use utopia_migration::Transfer;
Rust
pub struct Transfer

Moves resources from a Source into a Destination, sharing one Cache between them, and reports per-status counters.

Also implements Debug.
use utopia_migration::transfer::extract_services;
Rust
pub fn extract_services<S: AsRef<str>>(services: &[S]) -> Result<Vec<&'static str>>

The resource types of the given service groups, in order.

Rust
pub type Counters = IndexMap<String, i64>

Per-status counts of one resource type.

Rust
pub type Report = IndexMap<String, Value>

A source's report: resource type => count (size in MB, version a string).

Rust
pub const ALL_PUBLIC_RESOURCES: &[&str] = &[ types::USER, types::TEAM, types::MEMBERSHIP, types::AUTH_METHODS, types::POLICIES, types::OAUTH2_PROVIDER, types::FILE, types::BUCKET, types::FUNCTION, types::ENVIRONMENT_VARIABLE, types::DEPLOYMENT, types::SITE, types::SITE_VARIABLE, types::SITE_DEPLOYMENT, types::DATABASE, types::TABLE, types::INDEX, types::COLUMN, types::ROW, types::PROVIDER, types::TOPIC, types::SUBSCRIBER, types::MESSAGE, types::BACKUP_POLICY, types::PLATFORM, types::API_KEY, types::WEBHOOK, types::SMTP, types::PROJECT_VARIABLE,

Transfer::ALL_PUBLIC_RESOURCES.

Rust
pub const EXPORT_GROUPS: &[(&str, &[&str])] = &[ (group::AUTH, group::AUTH_RESOURCES), (group::DATABASES, group::DATABASES_RESOURCES), (group::STORAGE, group::STORAGE_RESOURCES), (group::FUNCTIONS, group::FUNCTIONS_RESOURCES), (group::MESSAGING, group::MESSAGING_RESOURCES), (group::SITES, group::SITES_RESOURCES), (group::INTEGRATIONS, group::INTEGRATIONS_RESOURCES), (group::BACKUPS, group::BACKUPS_RESOURCES), (group::PROJECTS, group::PROJECTS_RESOURCES), (group::DOMAINS, group::DOMAINS_RESOURCES), ]

The resources groups map onto, in the order sources export them (Source::exportResources()'s mapping).

Rust
pub const ROOT_RESOURCES: &[&str] = &[ types::BUCKET, types::DATABASE, types::DATABASE_DOCUMENTSDB, types::DATABASE_VECTORSDB, types::FUNCTION, types::SITE, types::USER, types::TEAM, types::PLATFORM, types::API_KEY, types::PROVIDER, types::TOPIC, types::MESSAGE, ]

The types that can be a transfer's single root (Transfer::ROOT_RESOURCES).

Rust
pub const STORAGE_MAX_CHUNK_SIZE: i64 = 1024 * 1024 * 5

Files and deployments move in chunks of this many bytes (5 MiB).

transfer::group

Own page
Rust
pub const AUTH: &str = "auth"

Users, teams and auth settings.

Rust
pub const AUTH_RESOURCES: &[&str] = &[t::USER, t::TEAM, t::MEMBERSHIP, t::HASH, t::AUTH_METHODS, t::POLICIES, t::OAUTH2_PROVIDER]

Transfer::GROUP_AUTH_RESOURCES.

Rust
pub const BACKUPS: &str = "backups"

Backup policies.

Rust
pub const BACKUPS_RESOURCES: &[&str] = &[t::BACKUP_POLICY]

Transfer::GROUP_BACKUPS_RESOURCES.

Rust
pub const DATABASES: &str = "databases"

Every database resource.

Rust
pub const DATABASES_DOCUMENTS_DB: &str = "documentsdb"

DocumentsDB resources.

Rust
pub const DATABASES_RESOURCES: &[&str] = &[ t::DATABASE, t::DATABASE_DOCUMENTSDB, t::DATABASE_VECTORSDB, t::TABLE, t::INDEX, t::COLUMN, t::ROW, t::DOCUMENT, t::COLLECTION, t::ATTRIBUTE, ]

Transfer::GROUP_DATABASES_RESOURCES.

Rust
pub const DATABASES_TABLES_DB: &str = "tablesdb"

TablesDB resources.

Rust
pub const DATABASES_VECTOR_DB: &str = "vectorsdb"

VectorsDB resources.

Rust
pub const DOCUMENTSDB_RESOURCES: &[&str] = &[t::DATABASE_DOCUMENTSDB, t::COLLECTION, t::INDEX, t::DOCUMENT]

Transfer::GROUP_DOCUMENTSDB_RESOURCES.

Rust
pub const DOMAINS: &str = "domains"

Domain rules.

Rust
pub const DOMAINS_RESOURCES: &[&str] = &[t::RULE]

Transfer::GROUP_DOMAINS_RESOURCES.

Rust
pub const FUNCTIONS: &str = "functions"

Functions.

Rust
pub const FUNCTIONS_RESOURCES: &[&str] = &[t::FUNCTION, t::ENVIRONMENT_VARIABLE, t::DEPLOYMENT]

Transfer::GROUP_FUNCTIONS_RESOURCES.

Rust
pub const GENERAL: &str = "general"

General settings.

Rust
pub const INTEGRATIONS: &str = "integrations"

Platforms, keys, webhooks and SMTP.

Rust
pub const INTEGRATIONS_RESOURCES: &[&str] = &[t::PLATFORM, t::API_KEY, t::WEBHOOK, t::SMTP]

Transfer::GROUP_INTEGRATIONS_RESOURCES.

Rust
pub const MESSAGING: &str = "messaging"

Messaging.

Rust
pub const MESSAGING_RESOURCES: &[&str] = &[t::PROVIDER, t::TOPIC, t::SUBSCRIBER, t::MESSAGE]

Transfer::GROUP_MESSAGING_RESOURCES.

Rust
pub const PROJECTS: &str = "projects"

Project settings.

Rust
pub const PROJECTS_RESOURCES: &[&str] = &[t::PROJECT_VARIABLE, t::PROJECT_PROTOCOLS, t::PROJECT_LABELS, t::PROJECT_SERVICES, t::PROJECT_EMAIL_TEMPLATE]

Transfer::GROUP_PROJECTS_RESOURCES.

Rust
pub const SITES: &str = "sites"

Sites.

Rust
pub const SITES_RESOURCES: &[&str] = &[t::SITE, t::SITE_VARIABLE, t::SITE_DEPLOYMENT]

Transfer::GROUP_SITES_RESOURCES.

Rust
pub const STORAGE: &str = "storage"

Buckets and files.

Rust
pub const STORAGE_RESOURCES: &[&str] = &[t::FILE, t::BUCKET]

Transfer::GROUP_STORAGE_RESOURCES.

Rust
pub const TABLESDB_RESOURCES: &[&str] = &[t::DATABASE, t::TABLE, t::INDEX, t::COLUMN, t::ROW]

Transfer::GROUP_TABLESDB_RESOURCES.

Rust
pub const VECTORSDB_RESOURCES: &[&str] = &[t::DATABASE_VECTORSDB, t::COLLECTION, t::ATTRIBUTE, t::INDEX, t::DOCUMENT]

Transfer::GROUP_VECTORSDB_RESOURCES.