Go Back   CP Web Hosting - reseller hosting > CP Questions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-20-2007, 05:21 AM
Senior Member
 
Join Date: May 2007
Posts: 345
Default Restoring the H-Sphere System Database From Backup

I want to Restore the H-Sphere System Database From Backup.

Plz. help
Reply With Quote
  #2 (permalink)  
Old 09-20-2007, 05:27 AM
Senior Member
 
Join Date: Apr 2007
Posts: 347
Default

Quote:
Originally Posted by mouse View Post
I want to Restore the H-Sphere System Database From Backup.

Plz. help
You can restore the H-Sphere system database from the backup made by the H-Sphere hs_bck script. If you back up your system PostgreSQL database manually using pg_dump, the procedure would be basically the same, except for the names and locations of the backed up system databases.

The backup destination directory for the /hsphere/shared/backup/hs_bck script is set in the /hsphere/shared/backup/hs_bck.cfg config file. The default location is:
BCK_DIR /var/backup

hs_bck stores the system data backup in the following files in the BCK_DIR directory:

<ARCHIVE>.tgz - the system data content; <ARCHIVE> is the name of the backup file set in hs_bck.cfg:
BACKUP hs_bck
Older backup files are named <ARCHIVE>.1.tgz, <ARCHIVE>.2.tgz, ...
hsphere.sql - the H-Sphere system database backup;
counter.sql, poll.sql, guestbook.sql - SiteStudio system databases are also backed up if SiteStudio is integrated with H-Sphere.


I. Restoring the H-Sphere database on a server where PostgreSQL is not installed:


Log in to the server as root:
su -
Install PostgreSQL to the server.
Start PostgreSQL for the first time:
On RedHat servers:
/etc/rc.d/init.d/postgresql start
On FreeBSD servers, you need to inititiate the PostgreSQL service database manually before you start Postgres:
su - pgsql -c initdb
/usr/local/etc/rc.d/010.pgsql.sh start
Log in as PosgreSQL user:
On RedHat servers (the PostgreSQL service database is initiated automatically on login):
su - postgres
On FreeBSD servers:
su - pgsql
Create the user wwwuser:
createuser wwwuser
Answer yes to all prompts.
Enter the PostgreSQL service database:
psql tempate1
Restore the wwwuser password:
alter user wwwuser with password 'old_password';
alter user pgsql with password 'old_password';
Here, old_password is the wwwuser password to be restored.
Quit from PostgreSQL:
\q
Configure PostgreSQL passwords in the ~pgsql/data/pg_hba.conf file, according to instructions provided in this file.
Here it may be also helpful to optimize H-Sphere memory usage for better PostgreSQL performance.
Restart PostgreSQL.
Create H-Sphere database:
createdb -U wwwuser hsphere
SiteStudio databases are created in the similar way.
Import the database content from the backup:
psql -U wwwuser -f <HS_BCK>/hsphere.sql hsphere
where <HS_BCK> is the backup directory. SiteStudio databases are imported in the similar way.


II. Restoring the H-Sphere database content if the database already exists:

Log in to the CP server as root:
su -
Drop the H-Sphere database:
dropdb -U wwwuser hsphere
Create the H-Sphere database:
createdb -U wwwuser hsphere
Import the database content from the backup:
psql -U wwwuser -f <HS_BCK>/hsphere.sql hsphere
where <HS_BCK> is the backup directory.
SiteStudio databases are restored in the same way.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:48 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0