Skip to content
Back

Memory error during migration

  • 0
  • Self Hosted
  • General
panda_p
25 Oct, 2025, 16:19

Appwrite migration crashes with the following message: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 33554440 bytes) in /usr/src/code/vendor/utopia-php/database/src/Database/Document.php on line 431

Is there a way to increase PHPs allowed memory? Or do I need to do something else?

TL;DR
During a migration, a memory error occurred due to PHP's memory limit being exceeded. To increase the memory limit, add "php -d memory_limit=2G appwrite ..." to your Docker setup, where "..." refers to additional parameters. This should resolve the issue.
Dannys95
25 Oct, 2025, 21:14

steps to replicate?

Oliva
25 Oct, 2025, 21:39

This happens because the migration is using more memory than PHP allows. You can increase the limit like: php -d memory_limit=2G appwrite ... Are you migrating a large collection or using Docker defaults? I can help fix it.

panda_p
26 Oct, 2025, 10:38

Thank you for your responses 🙂

I had to

  • reduce the days the audit-files are stored
  • delete documents from big collections but now the migration went through.

I am mainly using docker defaults. I have not found a corresponding .env-Variable regaring PHP. Where exactly do I have to input "php -d memory_limit=2G appwrite ..." and what does the ... stand for?

Oliva
29 Oct, 2025, 00:57

Glad it worked! I can show you exactly where to add that command in your Docker setup and what the “…” stands for. Send me a message and I’ll guide you step by step.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more