Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Postgresql question ??
Message
General information
Forum:
Linux
Category:
Internet Connection issues
Miscellaneous
Thread ID:
00659564
Message ID:
00659607
Views:
39
>>Sorry for my newbiest condition but I need to make this question.
>>
>>Recently I format my box, in the box I had some Postgresql Databases, as I understand the data of all that databases were in /var/lib/pgsql directory (SuSE distro) so I simply backup that dir doing a cp to another machine. Well until here all fine.
>>
>>I format my Linux partition and reinstall the packages, including Postgres, after that I try to make a simple copy (cp) of the backuped dir into the directory /var/lib/pgsql, overwriting the new dir and I thought that all will be ok. FALSE it doesn work, in fact POstgres not even start.
>>
>>So I have desinstalled Postgres and reinstall again, I try to start and start OK. My question, how can I put the old backup data in the new installation?.
>>
>>This were tests databases but I would like not to create all of them again.
>>
>>Thanks in advance.
>>
>>Melvin
>
>Uh oh. You have to use the PostgreSQL "dumpall" command to put the data into a script file which can read from by psql when you get your box setup.
>http://www.postgresql.org/idocs/index.php?app-pg-dumpall.html
>
>Examples
>
>To dump all databases:
>
>pg_dumpall > db.out
>
>To reload this database use, for example:
>
>psql -f db.out template1
>
>(It is not important to which database you connect here since the script file created by pg_dumpall will contain the appropriate commands to create and connect to the saved databases.)

I forgot to add that when you create test databases it is probably a good idea to save the commands that you used to create them into an ascii text file so that you can use "psql -f scriptfilename databasename".
Nebraska Dept of Revenue
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform