David_Ghost is trying to restore their Discourse forum from DigitalOcean to Lightsail but encounters a PostgreSQL error related to memory allocation (maintenance_work_mem is too low). pfaffman suggests increasing the setting in the PostgreSQL config file. sheng_hualuo provides a detailed step-by-step guide for restoring the forum using the command line, including backing up files, reinstalling Discourse, and using launcher commands to rebuild and restore. David_Ghost confirms that after adjusting the maintenance_work_mem setting in the PostgreSQL configuration file and restarting the app, the restoration succeeded. David_Ghost thanks both users for their help.
What I would do is enter the container, install vim, edit the postgres config file to increase the setting it complains about (restart with “sv restart postgres”) and restore from the command line.
./launcher enter app
Path: /etc/postgresql/13/main/postgresql.conf
The 13 in the path is the version number, and our version may not be the same. Go to the /etc/postgresql folder to view it
I will try to restore later by command line when i understand better how to send my backup by command line. For now, im getting a “permission denied (publickey)”. But its not discourse problem.
After executing the command you will be prompted to enter the domain name, you need to use ctrl+c to cancel the operation because you backed up app.yml
6. Enter the discourse configuration folder
1. cd /var/discourse/containers/ #enter configuration folder
2. rm app.yml #delete the configuration file created by default
3. upload your backup app.yml to this folder
4. cd ... # fallback to the discourse folder
5. . /launcher rebuild app # rebuild discourse
After rebuilding the discourse, start the restoration process
1. mkdir /var/discourse/shared/standalone/backups/default/ #Create a folder for backup files.
2. cd /var/discourse/shared/standalone/backups/default/ #Go to the folder and upload your site's backup files in this folder.
3. cd /var/discourse/ #Go back to the discourse folder.
4. . /launcher enter app #Enter the discourse container
5. discourse enable_restore #Enable discourse restore function
6. discourse restore your-site-backup.tar.gz # Start restoring the backup by replacing your-site-backup.tar.gz with the name of your site backup file
the path is correct i found the line for edit. I put 80mb limit + a restart app and it was worked very well. Im very happy. Thank you very much Sheng and @pfaffman.