Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: very slow migration #5891

Open
2 tasks done
AidenY69 opened this issue Jul 27, 2023 · 4 comments
Open
2 tasks done

馃悰 Bug Report: very slow migration #5891

AidenY69 opened this issue Jul 27, 2023 · 4 comments
Assignees
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.

Comments

@AidenY69
Copy link

馃憻 Reproduction steps

When upgrading my current AppWrite to the newest version, the migration takes multiple days.

馃憤 Expected behavior

Faster migration regardless of record size

馃憥 Actual Behavior

When upgrading my current AppWrite to the newest version, the migration takes multiple days. I have ~30 million records, but I feel like that shouldn't be impacting the migration since the database itself isn't changing, just the AppWrite code. Is there any solutions on how I can make this process faster, or is there something on AppWrite's end that you can do to optimize large migrations?

The platform has to be down during a migration, and with a 4 day estimation, that's pretty extreme for a scheduled downtime.

馃幉 Appwrite version

Version 1.3.x

馃捇 Operating system

Linux

馃П Your Environment

No response

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@AidenY69 AidenY69 added the bug Something isn't working label Jul 27, 2023
@joeyouss joeyouss self-assigned this Aug 1, 2023
@joeyouss
Copy link

joeyouss commented Aug 1, 2023

Hi!
Thank you for bringing this up, yes we are aware of this happening and we have a WIP PR for this #5876

@joeyouss joeyouss added the product / databases Fixes and upgrades for the Appwrite Database. label Aug 1, 2023
@stnguyen90
Copy link
Contributor

@AidenY69, what versions are you upgrading between?

I feel like that shouldn't be impacting the migration since the database itself isn't changing, just the AppWrite code

When running migrations, the database schema and documents are updated and Appwrite must iterate over everything.

@tripolskypetr
Copy link

tripolskypetr commented Sep 28, 2023

Right now I am using these PowerShell scripts because I need to export data into JSON format. That method is simple and guarantee the data to be readable, combinable from deferent sources and storable in Git
https://github.com/react-declarative/appwrite-backup-tool

@tripolskypetr
Copy link

@joeyouss I think JSON format export feature will be quite useful for AppWrite CLI

for (const collection of collections) {
  console.log(`Making backup of ${collection.$id}`);
  await fs.mkdir(`backup/databases/${database.$id}/${collection.$id}`, {
    recursive: true,
  });
  for await (const document of listDocuments(database.$id, collection.$id)) {
    console.log(
      `Writing ${document.$id} from ${collection.$id} from ${database.$id}`
    );
    await fs.writeFile(
      `backup/databases/${database.$id}/${collection.$id}/${document.$id}.json`,
      JSON.stringify(document, null, 2)
    );
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

4 participants