Hello again,
Let me start by thanking you for your help. My answer is a bit long, but it details the steps taken.
Ben after several tries since the last message, I still have the impossibility to execute the command gunzip < blabla with always an authentication error.
discourse@testforum-app:/var/www/discourse$ gunzip < public/backups/default/forum-francophone-home-assistant-2022-04-24-120337-v20220407195246.tar.gz | psql -U postgres -d copyme
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres"
I give you the steps performed :
-
I started from a fresh official installation.
-
My two backups are made with the latest version of Discourse.
-
I import and restore my “forumDest” backup.
-
I upload the “ForumOther” backup to
/var/discourse/shared/standalone/backups/default. -
I connect with SSH
-
I go to `cd /var/discourse
-
I enter the container with the command
./launcher enter app.
I unzip the archive “ForumOther.tar.gz” located in/var/discourse/shared/standalone/backups/default* I reset the password
root@testforum-app:/var/www/discourse/public/backups/default# ls
dump.sql.gz
forum-francophone-home-assistant-2022-04-24-120337-v20220407195246.tar.gz
home-assistant-communaute-francophone-2022-04-24-111032-v20220304162250.tar.gz
uploads
Here is the result of the
lscommandforum-francophone-home-assistant-2022-04-24-120337-v20220407195246.tar.gzbeingForumOtherandhome-assistant-communaute-francophone-2022-04-24-111032-v20220304162250.tar.gzbeingForumDest
I reset the postgres password with the following commands:
sudo -u postgres psql
\password postgres
(enter the new password)
\q
This gives :
root@testforum-app:/var/www/discourse/public/backups/default# sudo -u postgres psql
psql (13.6 (Debian 13.6-1.pgdg110+1))
Type "help" for help.
postgres=# \password postgres
Enter new password for user "postgres":
Enter it again:
postgres=# \q
- Creation of the “copyme” database
root@testforum-app:/var/www/discourse/public/backups/default# su postgres
postgres@testforum-app:/var/www/discourse/public/backups/default$ psql
psql (13.6 (Debian 13.6-1.pgdg110+1))
Type "help" for help.
postgres=# CREATE DATABASE "copyme2" ENCODING = 'utf8';
CREATE DATABASE
postgres=# \q
postgres@testforum-app:/var/www/discourse/public/backups/default$
- I run the command
postgres@testforum-app:/var/www/discourse/public/backups/default$ gunzip < forum-francophone-home-assistant-2022-04-24-120337-v20220407195246.tar.gz | psql -d copyme
or `gunzip < forum-francophone-home-assistant-2022-04-24-120337-v20220407195246.tar.gz | psql -U postgres -d copyme
as mentioned.
I can’t see the beginning of the process, but at the end it always puts me
invalid command \P�jvsחP�m���q��J[B���@$��W�t*����!&|Zz)��)��Q�6�AJ�Y��%!/6=�JR��J��BPþ�A�)�YTZ�j��=! M��^bCO)+mi9���u�p�E��a��50��E�y��P���і��TxȐ��OȾ����B�)Wl��Ad�������:���}1���,kNDo�O�'�)G��^W����5��
:��B�eIx7!N��;q�À@�#j���*
invalid command \�6���`�3�
invalid command \�2����)��V��D��4{]�
ERROR: invalid byte sequence for encoding "UTF8": 0x89
postgres@testforum-app:/var/www/discourse/public/backups/default$
So I understand that there is a problem with the encoding?
What I tried:
Disassociating the commands:
- Unzipping the ForumOther backup
gunzip < forum-francophone-home-assistant-2022-04-24-120337-v20220407195246.tar.gzwhich seems to extract something in incomprehensible language - Enter on the DB
psql -d copyme
postgres@testforum-app:/var/www/discourse/public/backups/default$ psql -d copyme
psql (13.6 (Debian 13.6-1.pgdg110+1))
Type "help" for help.
copyme=#
But once connected to the “copyme” base I don’t see what to do.
I looked at the following for the IMPORT commands, but same thing, where should they be executed? How to do it? With which user?
Let’s try step by step.
If I succeed, I will put more precisely my procedure by detailing a little more than the original tutorial (which has the merit to explain the main principles and to exist).
Thanks again for your time and help.