| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 12 Oct 2009 05:18:09
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
I have developed a web application on my MacBook Pro and am about to deploy it on a remote Mac Mini. Since I haven't done this before, I wonder what is the best way to proceed.
Kind regards,
Annet
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 12 Oct 2009 08:57:48
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
On the database side, you'll want to dump the database using pg_dump:
pg_dump -h localhost -d databasename > db.sql
And you'll want to get all the database users and passwords with:
pg_dumpall -h localhost -g > users.sql
Then, import those on your mac-mini with the following (note: users first)
psql -f users.sql
createdb databasename
psql -d databasename -f db.sql
That should deploy the database. The webapp is the trick and that all depends on how you built your app.
--Scott
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 10:37:33
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
On my MacBook Pro I run Postgres Plus 8.3 with pgadmin III. When I open the
Interactive SQL Terminal I end up in a Terminal window asking me the password
for user postgres, the superuser. The database I want to back up is owned bij
another user.
When I go with the flow, and enter the password for user postgres, this is what happens.
imac:~ imac$ /Library/PostgresPlus/8.3/bin/psql -p 5432 -h localhost -U postgres postgres && exit || sleep 5 && exit
Password for user postgres:
Welcome to psql 8.3.3, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#
When I then do:
pg_dump -h localhost -d fitwise_nl > db.sql
postgres-#
Nothing happens. When I alter the command to read like:
/Library/PostgresPlus/8.3/bin/psql -p 5432 -h localhost -U myuser
this is what happens:
Password for user myuser:
psql: FATAL: password authentication failed for user "myuser"
mymac:~ mymac$
How do I proceed to dump the database.
Kind regards,
Annet
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 10:49:07
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
imac:~ imac$ /Library/PostgresPlus/8.3/bin/psql -p 5432 -h localhost -U postgres postgres && exit || sleep 5 && exit
Password for user postgres:
Welcome to psql 8.3.3, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#
When I then do:
pg_dump -h localhost -d fitwise_nl > db.sql
postgres-#
You're typing pg_dump in the wrong place. You do it from the OS command line, don't login with psql first.
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 10:56:35
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Hi Scott,
When I open the Terminal and do
imac:~ imac$ pg_dump -h localhost - fitwise_nl > db.sql
-bash: pg_dump: command not found
imac:~ imac$
Is that because I have Postgres Plus 8.3 installed?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 10:58:28
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
Annet_V wrote:Hi Scott,
When I open the Terminal and do
imac:~ imac$ pg_dump -h localhost - fitwise_nl > db.sql
-bash: pg_dump: command not found
imac:~ imac$
Is that because I have Postgres Plus 8.3 installed?
/Library/PostgresPlus/8.3/bin/pg_dump
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 11:27:04
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Hi Scott,
That worked I now have a db.sql and a users.sql file. Running them using phppgadmin resulted in an enormous amount of errors, so I guess I will have to try my luck using SSH.
Have you used SHH to execute the commands you provided me with?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 11:32:35
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
What errors did you get? Sometimes those errors just means that you already had the objects created. Can you post a text file with the errors in it?
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 11:54:39
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
I attached a text file with the errors.
postgres is the superuser, created when I installed postgres plus 8.3. I then created a role myuser in pgadmin which own the database I dumped.
I dumped the database using: imac:~ imac$ /Library/PostgresPlus/8.3/bin/pg_dump -U postgres -h localhost -d fitwise_nl > db.sql
The database created on the server through phppgadmin is owned by myuser, maybe that is one of the causes of the many errors.
Kind regards, I very much appreciate your help.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 11:55:20
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Sorry, forgot the attachment.
| Filename |
errors.rtf |
Download
|
| Description |
|
| Filesize |
87 Kbytes
|
| Downloaded: |
740 time(s) |
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 12:07:42
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
The database created on the server through phppgadmin is owned by myuser, maybe that is one of the causes of the many errors.
Correct, you have a bunch of lines in there:
This means that you don't have superuser privs. Run the scripts as superuser and you should be better.
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 15 Oct 2009 12:31:21
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
I will give it a try first thing in the morning. It is getting late here.
I hope that when I have some more questions on this topic you will
be there tomorrow.
One more question right now.
On my mac mini the ISP has root access because he manages the server.
Then there is a user postgres both as unix user and as posgres superuser.
To enter phppgadmin I had to create a new user, because root or posgres as a
username is not allowed. I then created pgadmin as a superuser to log
in to phppgadmin.
When I create a database in phppgadmin the owner is the user that
is logged in. In pgadmin III the database is also owned by one user.
The database I dumped is owned by myuser (which is also the username in the
connection string in the web application I built). When I drop the database
and create a new database owned by superuser postgres, how do I give user
myuser access to the database too? In both pgadmin and phppgadmin I couldn't
find an option to do this. I presume a database is owned by one user, and more
user can have access to the database?
Kind regards,
Annet
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 16 Oct 2009 03:21:51
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Hi Scott,
Making postgres the owner of all database object solved part of the problem.
I attached a text file with the latest errors. I hope you can point me in the right
direction to solve problem. Do I have to solve them for the database to run
properly, or are they related to peripheral issues?
Kind regards,
Annet.
This message was edited 1 time. Last update was at 16 Oct 2009 11:49:48
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 16 Oct 2009 08:45:13
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
I think you attached your database dump acceidentally. Can you send the log?
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 16 Oct 2009 11:51:09
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Sorry, must be the annoyance.
Here's the correct file.
| Filename |
errors_version_2.rtf |
Download
|
| Description |
|
| Filesize |
87 Kbytes
|
| Downloaded: |
1139 time(s) |
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18 Oct 2009 03:00:22
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Hi Scott,
I think the fact that on my local computer I run PostgresPlus and my Hosting Provider has installed Postgres on the Server is the cause of all the error messages. I will ask my ISP to uninstall Postgres and install PostgresPlus.
Thanks for the time you spent helping me solve the problem.
Kind regards,
Annet
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 19 Oct 2009 10:29:38
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
Annet,
Looks to me like you are correct. The errors you're getting are due to features that exist in PostgresPlus by default but are add-ons to Open-Source PG.
Thanks!
Let me know if you need anymore help.
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 19 Oct 2009 12:56:53
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Scott,
> Looks to me like you are correct. The errors you're getting are due to features that exist in PostgresPlus by default but are add-ons to Open-Source PG.
It took me some time to figure that out, but at least I did find out and learned a lot while doing so.
>Let me know if you need anymore help.
My ISP installed PostgresPlus today, and I uploaded the dump to the server and ran it. I am still getting error messages but they all read something like:
already exists with same argument types
... so I assume I am alright now. To be sure I attached the latest text file with the error messages, so you can have a look at them
Thanks for your help,
Kind regards,
Annet.
| Filename |
errors_version_3.rtf |
Download
|
| Description |
|
| Filesize |
79 Kbytes
|
| Downloaded: |
850 time(s) |
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 20 Oct 2009 08:23:34
|
scottiebo
Senior member
![[Avatar]](/images/avatar/2d0122e6c17cdb89f8eed4d75b5f5eef.png)
Joined: 23 Oct 2005 21:05:02
Messages: 197
Offline
|
Annet_V wrote:
... so I assume I am alright now. To be sure I attached the latest text file with the error messages, so you can have a look at them
You're right, they're just things that are built-ins. You're all set!
|
--Scottie |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 20 Oct 2009 14:17:59
|
Annet_V
Member
Joined: 5 Oct 2008 12:08:07
Messages: 21
Offline
|
Hi Scott,
Thanks, I very much appreciated your help.
Annet.
|
|
|
 |
|
|