transfer
ModuleThe 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;pub struct ReportEntryOne line of Transfer::report.
use utopia_migration::ResourceSelector;pub struct ResourceSelectorA 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;pub struct TransferMoves resources from a Source into a Destination, sharing one
Cache between them, and reports per-status counters.
Debug.use utopia_migration::transfer::extract_services;pub fn extract_services<S: AsRef<str>>(services: &[S]) -> Result<Vec<&'static str>>The resource types of the given service groups, in order.
pub type Counters = IndexMap<String, i64>Per-status counts of one resource type.
pub type Report = IndexMap<String, Value>A source's report: resource type => count (size in MB, version a
string).
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.
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).
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).
pub const STORAGE_MAX_CHUNK_SIZE: i64 = 1024 * 1024 * 5Files and deployments move in chunks of this many bytes (5 MiB).
transfer::group
Own pagepub const AUTH: &str = "auth"Users, teams and auth settings.
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.
pub const BACKUPS: &str = "backups"Backup policies.
pub const BACKUPS_RESOURCES: &[&str] = &[t::BACKUP_POLICY]Transfer::GROUP_BACKUPS_RESOURCES.
pub const DATABASES: &str = "databases"Every database resource.
pub const DATABASES_DOCUMENTS_DB: &str = "documentsdb"DocumentsDB resources.
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.
pub const DATABASES_TABLES_DB: &str = "tablesdb"TablesDB resources.
pub const DATABASES_VECTOR_DB: &str = "vectorsdb"VectorsDB resources.
pub const DOCUMENTSDB_RESOURCES: &[&str] = &[t::DATABASE_DOCUMENTSDB, t::COLLECTION, t::INDEX, t::DOCUMENT]Transfer::GROUP_DOCUMENTSDB_RESOURCES.
pub const DOMAINS: &str = "domains"Domain rules.
pub const DOMAINS_RESOURCES: &[&str] = &[t::RULE]Transfer::GROUP_DOMAINS_RESOURCES.
pub const FUNCTIONS: &str = "functions"Functions.
pub const FUNCTIONS_RESOURCES: &[&str] = &[t::FUNCTION, t::ENVIRONMENT_VARIABLE, t::DEPLOYMENT]Transfer::GROUP_FUNCTIONS_RESOURCES.
pub const GENERAL: &str = "general"General settings.
pub const INTEGRATIONS: &str = "integrations"Platforms, keys, webhooks and SMTP.
pub const INTEGRATIONS_RESOURCES: &[&str] = &[t::PLATFORM, t::API_KEY, t::WEBHOOK, t::SMTP]Transfer::GROUP_INTEGRATIONS_RESOURCES.
pub const MESSAGING: &str = "messaging"Messaging.
pub const MESSAGING_RESOURCES: &[&str] = &[t::PROVIDER, t::TOPIC, t::SUBSCRIBER, t::MESSAGE]Transfer::GROUP_MESSAGING_RESOURCES.
pub const PROJECTS: &str = "projects"Project settings.
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.
pub const SITES: &str = "sites"Sites.
pub const SITES_RESOURCES: &[&str] = &[t::SITE, t::SITE_VARIABLE, t::SITE_DEPLOYMENT]Transfer::GROUP_SITES_RESOURCES.
pub const STORAGE: &str = "storage"Buckets and files.
pub const STORAGE_RESOURCES: &[&str] = &[t::FILE, t::BUCKET]Transfer::GROUP_STORAGE_RESOURCES.
pub const TABLESDB_RESOURCES: &[&str] = &[t::DATABASE, t::TABLE, t::INDEX, t::COLUMN, t::ROW]Transfer::GROUP_TABLESDB_RESOURCES.
pub const VECTORSDB_RESOURCES: &[&str] = &[t::DATABASE_VECTORSDB, t::COLLECTION, t::ATTRIBUTE, t::INDEX, t::DOCUMENT]Transfer::GROUP_VECTORSDB_RESOURCES.