Kan ik gewoon de hele /var/discourse tarren en deze op een nieuwe server draaien?

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 likes

Ook, als je nog geen
./launcher cleanup
hebt uitgevoerd, heb je mogelijk een heleboel docker-images die ruimte innemen.

5 likes

Ik denk dat docker system prune kan helpen

Ik heb het geprobeerd, het vrijgegeven tot 44 GB, mijn server totaal 98 en toen heb ik S3 opnieuw gestart, het werkt nog steeds niet, heb niet genoeg ruimte, weet niet wat Discourse zei over back-ups die zo groot zijn

[2025-08-20 10:11:31] Back-up finaliseren…

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

[2025-08-20 10:11:31] Zorgen dat het archief nog niet bestaat…

[2025-08-20 10:11:31] Leeg archief maken…

[2025-08-20 10:11:31] Gegevensdump archiveren…

[2025-08-20 10:11:31] Uploads archiveren…

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

[2025-08-20 10:16:36] Archief gzippen, dit kan even duren…

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

Archief kon niet worden gegzipd.

gzip: /var/www/discourse/public/backups/default/discourse-2025-08-20-101058-v20250812033430.tar.gz: Geen ruimte meer op apparaat

[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] Oude back-ups verwijderen…

[2025-08-20 10:28:06] Dingen opruimen…

[2025-08-20 10:28:06] ‘.tar’ restanten verwijderen…

[2025-08-20 10:28:07] Back-up markeren als voltooid…

[2025-08-20 10:28:07] ‘VegaMonika’ informeren over het einde van de back-up…

Ik denk dat je het .tar-bestand dat zich in /var/discourse/shared/standalone/backups/default bevindt, moet verwijderen.

Het lijkt erop dat je meer uploads hebt dan er in een back-up passen. Je zult (1) een grotere schijf moeten krijgen, (2) assets naar Spaces of S3 moeten verplaatsen, (3) uploads naar een volume moeten verplaatsen, (4) uploads niet moeten back-uppen.

De eenvoudigste directe oplossing, nadat je het .tar-bestand hebt verwijderd, is om geen uploads te back-uppen.

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 like

Het is een rommelige manier van verhuizen, maar zolang het een standaardinstallatie is en je ervoor zorgt dat je eerst al je docker containers stopt, zal het waarschijnlijk werken.

1 like

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.