Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Mar 19, 2019 5:45 am
Voice Broadcast System


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: pg_dump error guidance required
PostPosted: Wed Dec 10, 2008 5:29 pm 
Offline

Joined: Wed Jul 11, 2007 9:27 pm
Posts: 55
Location: USA
Hi ,

I want to transport all pin and information from old version of a2billing to new one. That old one in web interface there was no database backup
option which has in the new one. So option left in from psql database
pg_dump command.
But i fail to succeed to dump as it showing connection to database error.

Can any one guide me to dump the database file?

I tried with these command

first logged in as super user
su postgres
$ pg_dump -h serverip -v -u -f /home/db.sql a2billing
here a2billing is my existing database which i want to dump as db.sql
is it ok ? but this is huge i might need to gunzip it ok later we can think.

the error shows for this command connection to database a2billing failed
no pg_hba.conf entry for host server ip for user postgres database a2billing. and so in pg_hba.conf i add the line again
host all all serverip 255..... trust
but not work yet .

the simple way to be as i found other tutorial
pg_dump dbname | gzip > filename.gz

but it says also permission denied.

can any one help from the begining how i will solve the total thing?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 6:18 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Use the same credentials to connect to Postgres that A2B is using. For a reminder of these credentials try: head -n20 /etc/asterisk/a2billing.conf


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 8:54 pm 
Offline

Joined: Wed Jul 11, 2007 9:27 pm
Posts: 55
Location: USA
Hello stavros again,
ok follow the same credentials you mean in a2billing.conf in database context whatever their i have to follow right?
so i use the as following

pg_dump -i -h localhost -p 5432 -U postgres -F -f /home/db.sql a2billing

this shows too many command line option

what i do now?

the next line what you said where will i execute that?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 9:10 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
mushfiq wrote:
the next line what you said where will i execute that?
At a Bash prompt, the same as the other commands you're using.
I use this with no problems:
Code:
pg_dumpall -c -h localhost -U postgres | gzip > pgsql-backup.gz
To restore:
Code:
zcat pgsql-backup.gz | psql -h localhost -U postgres


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 9:27 pm 
Offline

Joined: Wed Jul 11, 2007 9:27 pm
Posts: 55
Location: USA
In tutorial it says

- c, means –clean clean (drop) schema prior to create

is it not harmful? i do not want to destroy my existing one. Just for caution
i am asking these fool question .

ok by this command

pg_dumpall -c -h localhost -U postgres | gzip > pgsql-backup.gz

where my existing database a2billing have mentioned?
where this file will be saved ? in tmp ?
sorry i m asking too many question as i am totally blind in database.
your help is appreciated sir.

Added after 7 minutes:

i test the command without -c it still shows pin-back.gz: permission denied


where will i check this permission denied thing?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 9:28 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
mushfiq wrote:
is it not harmful? i do not want to destroy my existing one.
It harmless during the backup; it won't drop anything. Only when you restore the backup will it drop the existing tables. Feel free to omit the '-c' if that's not what you want.
Quote:
where this file will be saved ? in tmp ?
It will be saved to the current directory. If you want to save elsewhere, simply change the filename 'pgsql-backup.gz'.
Quote:
i test the command without -c it still shows pin-back.gz: permission denied
That means you don't have permission to write to the current directory. Try writing the file to a directory that you do have write access to. I have a feeling you're logged in as the 'postgres' user; this is not necessary, you should be logged in as your usual day-to-day user.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 11:33 pm 
Offline

Joined: Wed Jul 11, 2007 9:27 pm
Posts: 55
Location: USA
You are genious . you are right i had no write permission in current folder and not suppose to not execute from postgres which i was doing actually and it did backed up.

But dont go away now i need to restore it in the new a2billing.
it should be easier right ? from web interface.

Added after 52 minutes:

problem again stavros.

Now i am restoring from a2billing web interface just selecting the file and upload command it says upload done but i dont see any pin of that database in this new server list customer

what is wrong?

Added after 34 minutes:

ok for restoring

i follow your command
zcat pgsql-backup.gz | psql -h localhost -U postgres

it shows lot of invalid command \.
and finally error at or near "1"
line 1 : 1 1 44 uk 0.2 0 0 0.3 0 0 0 0 0 0 0 0 2005-0.....

what is now to be done?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group