האם אני יכול פשוט לעשות tar לכל /var/discourse ולהריץ אותו בשרת חדש?

Because when I try to migrate using the built-in backup, the compression process quickly fills up my disk. I still had around 60GB free space, but during backup the disk goes full and fails.

However, if I just manually compress the entire /var/discourse folder, the archive is only about 30GB (the folder itself is about 34GB).

Because the capacity is released directly when it is full, I took a screenshot at 80%.

So my questions are:

•	Can I simply tar/pack the entire /var/discourse folder, move it to a new server, extract it, and then run Discourse?

•	Or do I have to follow the recommended way (database backup + copy uploads separately)?

•	Is there any method to avoid the disk filling up during the backup compression process?

Hey,

Have a look at this:

Yes, having more free space :slight_smile:

That obvious answer aside, there are feature requests to prevent backups from taking more space on creation, but they have not been fulfilled yet: Reduce local disk space needs by not (redundantly) gzipping backups & Add option to disable backup compression

4 לייקים

וגם, אם עוד לא הרצתם

./launcher cleanup

ייתכן שיש לכם הרבה תמונות דוקר שתופסות מקום.

5 לייקים

אני חושב ש-docker system prune עשוי לעזור

ניסיתי, שחררתי 44gb השרת שלי סך הכל 98 ואז הפעלתי את s3 שוב זה עדיין לא עובד אין מספיק מקום לא יודע מה דיסקרוס אמר על גיבויים שהם כל כך גדולים

[2025-08-20 10:11:31] Finalizing backup…

[2025-08-20 10:11:31] Creating archive: discourse-2025-08-20-101058-v20250812033430.tar.gz

[2025-08-20 10:11:31] Making sure archive does not already exist…

[2025-08-20 10:11:31] Creating empty archive…

[2025-08-20 10:11:31] Archiving data dump…

[2025-08-20 10:11:31] Archiving uploads…

[2025-08-20 10:16:35] Removing tmp ‘/var/www/discourse/tmp/backups/default/2025-08-20-101058’ directory…

[2025-08-20 10:16:36] Gzipping archive, this may take a while…

[2025-08-20 10:28:05] EXCEPTION: gzip -1 /var/www/discourse/public/backups/default/discourse-2025-08-20-101058-v20250812033430.tar

Failed to gzip archive.

gzip: /var/www/discourse/public/backups/default/discourse-2025-08-20-101058-v20250812033430.tar.gz: No space left on device

[2025-08-20 10:28:05] /var/www/discourse/lib/discourse.rb:171:in `execute_command’

/var/www/discourse/lib/discourse.rb:137:in `exec’

/var/www/discourse/lib/discourse.rb:32:in `execute_command’

/var/www/discourse/lib/backup_restore/backuper.rb:253:in `create_archive’

/var/www/discourse/lib/backup_restore/backuper.rb:40:in `run’

/var/www/discourse/script/spawn_backup_restore.rb:9:in `backup’

/var/www/discourse/script/spawn_backup_restore.rb:31:in `block in ’

/var/www/discourse/script/spawn_backup_restore.rb:4:in `fork’

/var/www/discourse/script/spawn_backup_restore.rb:4:in `’

[2025-08-20 10:28:05] Deleting old backups…

[2025-08-20 10:28:06] Cleaning stuff up…

[2025-08-20 10:28:06] Removing ‘.tar’ leftovers…

[2025-08-20 10:28:07] Marking backup as finished…

[2025-08-20 10:28:07] Notifying ‘VegaMonika’ of the end of the backup…

אני חושב שתצטרך למחוק את קובץ ה-.tar שנותר ב-/var/discourse/shared/standalone/backups/default

נראה שיש לך יותר קבצים להעלאה ממה שיכולים להיכנס לגיבוי. תצטרך (1) להשיג דיסק גדול יותר, (2) להעביר נכסים ל-Spaces או S3, (3) להעביר קבצים להעלאה לנפח אחסון, (4) לא לגבות קבצים להעלאה

הפתרון המיידי הפשוט ביותר, לאחר שתמחק את קובץ ה-.tar, הוא לא לגבות קבצים להעלאה.

I have done a version of this as part of a move from one EC2 instance to a larger one, but with the caveat that the new server I was using was going to have the exact same base OS image, hostname, installed software, and IP address as the old one. After moving /var/discourse to the new box, I ran a launcher rebuild app and the site came right up.

So under those very specific circumstances, it worked great the one time I tried it.

לייק 1

זו דרך מבולגנת לעבור, אבל כל עוד זו התקנה ברירת מחדל ואתה מוודא שאתה עוצר את כל קונטיינרי הדוקר שלך תחילה, זה כנראה יעבוד

לייק 1

snap remove aws-cli

.\\launcher stop app

docker system prune

apt autoremove

.\\launcher enter app

discourse backup

docker cp “app:/var/www/discourse/public/backups/default/your-site-2006-01-02-150405-v20200101150405.tar.gz “ “root@[server_ip_address]:/var/discourse/shared/standalone/backups/default/your-site-2006-01-02-150405-v20200101150405.tar.gz“

exit

snap install aws-cli --classic

aws configure

aws s3 cp “/var/discourse/shared/standalone/backups/default/your-site-2006-01-02-150405-v20200101150405.tar.gz“ “myBucket://your-site-2006-01-02-150405-v20200101150405.tar.gz“

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.