Installing Openbravo with database backup file - postgresql

How to install openbravo with database backup?
I have a postgresql dump file and I want to install openbravo with this sql file.

Steps To dump database locally
1)Open pgadmin GUI, create new database say 'db_name'
2)Go to command prompt, issue following*(sql_File_Path may vary)*
C:\Program Files (x86)\PostgreSQL\9.0\bin>psql -U postgres -f sql_File_Path db_name
3)Edit the Openbravo.properties file *bbdd.sid=db_name*
4)ant smartbuild -Dlocal=no
5)Restart the tomcat.
Note:
You should have a compiled source code of Openbravo , Otherwise you will get an error during Smartbuild.

Related

restore db postgres - format .gz

I am trying to restore a database on my local machine. I downloaded this database from the server in file.gz format. Inside this archive is the file file.out. How can I restore the entire structure on my computer through
pg_admin or via console?
If I understand correctly, you need to use the pg_restore command. But all my attempts end with a syntax error.

How do I launch postgresql on terminal without using homebrew? (SQL state: 42501, trying to import CSV to pgAdmin4 with COPY)

I am unable to import a CSV with postgres(v12) into pgAdmin4 using the copy command.
COPY revenue
FROM "../Desktop/Home/revenue.csv"
DELIMITER ','
CSV HEADER;
The result I get is:
ERROR: could not open file "../Desktop/Home/revenue.csv" for reading: Permission denied
HINT: COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's \copy.
SQL state: 42501
I found article
How to import a CSV file into PostgreSQL using Mac
but it was unsolved and I already tried ging the user 'postgres' 'read and write' permissions. Maybe I did it wrong, I right clicked on the CSV file and I also tried giving it permission in pgAdmin4 (properties, default privileges)
I found the solution below suggesting I launch postgres from my command line
Postgres ERROR: could not open file for reading: Permission denied
However everything I read on launching postgres on a mac via command line includes homebrew. I didn't install postgresql with homebrew.
-Can I launch postgres on a mac without using homebrew?
If I install homebrew, will it work to launch postgresql even if I didn't use it to install postgres initially?
-Is there another way to use the copy command via pgadmin ? (I tried using dbeaver but it wouldn't connect to my database)
I am super lost.
Thank you!

Dump Contents of RDS Postgres Query

Short Version of this Question:
I'd like to dump the contents of a Postgres query from a db instance hosted in RDS inside of a shell script.
Complete Version:
Right now I'm writing a shell script that I would like to dump the contents of a query into a .dump file from a source database, and run the dump file on a destination database instance. Both db instances are hosted in RDS.
MySQL allows you to do this using the mysqldump tool, but the recommended answer to this problem in Postgres seems to be to use the COPY command. However, the COPY command isn't available in RDS instances. The recommended solution in this case seems to be to use the '\copy' command, which does the same thing locally using the psql tool. However, it doesn't seem like this is a support option inside of a shell script.
What's the best way to accomplish this?
Thank you!
I am not familiar with shell, but I have used batch file in Windows to dump output of query to a file and to import the file on another instance.
Here is what I used to export from postgres RDS to file on Windows.
SET PGPASSWORD=your_password
cd "C:\Program Files (x86)\pgAdmin 4\v3\runtime"
psql -h your_host -U your_username -d your_databasename -c "\copy (your_query) TO
path\file_name.sql"
All above commands are in one batch file.

Moving a firebird 2.5 database

So currently I have firebird 2.5 installed and running on Windows, working fine but performance is a bit slow.
I have installed 2.5 on Ubuntu, and I can connect to the current database with ISQL easily:
connect "192.168.155.112:C:\database\database.FDB" user 'SYSDBA' password 'adminpassword';
So I stopped the firebird services on the Windows server, copied the file to the Ubuntu server, and in isql tried to run:
SQL> connect "localhost:/var/lib/firebird/2.5/data/database.FDB" user 'SYSDBA' password 'adminpassword';
Statement failed, SQLSTATE = m
file /var/lib/firebird/2.5/data/database.FDB is not a valid database
Note I have so far tried:
~$ sudo adduser `id -un` firebird
[sudo] password for luke:
The user `luke' is already a member of `firebird'.
As well as
# chown firebird /var/lib/firebird/2.5/data/database.fdb
With no luck, if anyone has any idea as to why I might be getting this error, I would be very grateful :)
I am not sure if Super or Classic was used on Windows, however I have tried using both on Ubuntu with the same error message. Windows server version 2.5.6, same version on Linux
You need to backup the database using gbak, and then restore it using gbak.
To backup:
gbak -backup employee D:\backups\employee.fbk
To restore:
gbak -c /backups/employee.fbk employee
Where employee is either the path or the alias of the database.
See also the gbak manual for more information.

Where to find the PostgreSQL db file in Cloud9?

I recently switched from SQLite to PostgreSQL and am using Cloud9 IDE (Rails). With SQLite there was a file db/development.sqlite that I could open to examine the db contents. Where can I find a similar file now I've switched to PostgreSQL?
You should be able to use the following:
sudo sudo -u postgres psql
to access your PostgreSQL server. Here's some documentation from Cloud9 regarding PostgreSQL.