health
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Health] Restore data to new installation


From: Yusif Suleiman
Subject: Re: [Health] Restore data to new installation
Date: Mon, 9 May 2022 14:37:33 +0000

Dear Luis,
Thank you so much for the detail information.

I will get back as soon as I try it.
Regards,
Yusuf

From: Luis Falcon <falcon@gnuhealth.org>
Sent: Monday, May 9, 2022 11:13 AM
To: Yusif Suleiman <yusifsuleiman@hotmail.com>
Cc: General GNU Health discussion and help <health@gnu.org>
Subject: Re: [Health] Restore data to new installation
 
Dear Yusif

Just some general comments. Because I am focus on the vanilla
installation, they might not apply to this, but at least some general
tips on the commands you're trying to run
 

On Mon, 9 May 2022 08:07:13
+0000 Yusif Suleiman <yusifsuleiman@hotmail.com> wrote:

> Thank you, Gerald.
> I check the files with 'ls' command, all files are in the directory.
> I use the 'psql newdb' then copy the syntax one after the other, but
> all in vain.
>
> Here are my repeated efforts. Please have look at. What have I miss?
>
> user@localhost:~/Desktop> su 
> Password:
>
Be careful to use only "su" instead of "su -", specially related to
environment variables. Use "sudo whenever you can.

>
> postgres@localhost:/home/user/Desktop> createdb newdb
> --encoding='UTF-8' --owner=tryton createdb: error: database creation
> failed: ERROR:  database "newdb" already exists

Basically, the DB already exists, so you can not create it again. You
would need to drop it first if you want to start from scratch.

>
> postgres@localhost:/home/user/Desktop> psql newdb
> gnuhealth_Fitrah_DB_with_fs_backup_2022-04-18_143054.tar psql: error:
> connection to server on socket "/var/run/postgresql/.s.PGSQL.5432"
> failed: FATAL:  role
> "gnuhealth_Fitrah_DB_with_fs_backup_2022-04-18_143054.tar" does not
> exist
>

A couple of issues here:

1) The "gnuhealth_Fitrah_DB_with_fs_backup_2022-04-18_143054.tar" is a
tar file. You need to extract them first, because it has both the
filesystem and the database dump (usually it ends in .sql). It is that
file the one you need to load.


2) You forgot the "<" redirector on psql. If you want to load a
database dump, you need to redirect the file to be processed

example:

psql newdb < health40.sql (or whatever name you have for your db)

PS: When things get a bit stuck, is best to try to solve them
interactively, in GNU Health Matrix chat.

I recommend you join us in the GNU Health matrix space.

https://matrix.to/#/#gnuhealth-space:matrix.org

There you can find all the rooms related to the GH ecosystem.

All the best
Luis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]