How to backup up the default Postgresql Database?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2011 11:32 AM
Hi,
I used the bundled Linux installer to install Community 4.0a. How do I backup the included Postgresql Database? My attempts to at using the psql and postgres commands to login into SQL prompt me to install the PostgreSql package, but I know it's already running.
I used the bundled Linux installer to install Community 4.0a. How do I backup the included Postgresql Database? My attempts to at using the psql and postgres commands to login into SQL prompt me to install the PostgreSql package, but I know it's already running.
Labels:
- Labels:
-
Archive
14 REPLIES 14
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2013 11:36 AM
Well, i think that all you need to do is configure an scheduled backup of the database.
For windows, you can follow this:
http://wiki.postgresql.org/wiki/Automated_Backup_on_Windows
The fact, is that in windows you will need to have any tool to configure a scheduled task to do that, but should´t be difficult.
I hope this helps,
Regards
For windows, you can follow this:
http://wiki.postgresql.org/wiki/Automated_Backup_on_Windows
The fact, is that in windows you will need to have any tool to configure a scheduled task to do that, but should´t be difficult.
I hope this helps,
Regards
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2013 01:10 AM
Hi Isra,
Thank you for the tips to have a scheduled backup of the database. Really helps!
Thanks~
JP
Thank you for the tips to have a scheduled backup of the database. Really helps!

Thanks~
JP

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2013 10:35 AM
#1 stopping alfresco services
./opt/alfresco/alfresco.sh stop
#2 backup file system
tar czvf /opt/alfresco-bkp/alf_data_$(date +%Y%m%d-%H%M%S).tgz /opt/alfresco/alf_data
#3 backup alfresco database (postgres needs to be started)
# don´t mix up os user and postgres user, by default there is no alfresco os user
/opt/alfresco/postgresql/bin
su postgres ./pg_ctl start
su postgres -c './pg_dump -U alfresco alfresco | gzip > /opt/alfresco-bkp/postgres_$(date +%Y%m%d-%H%M%S).dmp.gz'
su postgres ./pg_ctl stop
#4 starting alfresco services
./opt/alfresco/alfresco.sh start
I found this article helpful to create a cron job: http://grover.open2space.com/content/postgresql-84-database-backups-pg_dump-and-cron
kr
Josef
./opt/alfresco/alfresco.sh stop
#2 backup file system
tar czvf /opt/alfresco-bkp/alf_data_$(date +%Y%m%d-%H%M%S).tgz /opt/alfresco/alf_data
#3 backup alfresco database (postgres needs to be started)
# don´t mix up os user and postgres user, by default there is no alfresco os user
/opt/alfresco/postgresql/bin
su postgres ./pg_ctl start
su postgres -c './pg_dump -U alfresco alfresco | gzip > /opt/alfresco-bkp/postgres_$(date +%Y%m%d-%H%M%S).dmp.gz'
su postgres ./pg_ctl stop
#4 starting alfresco services
./opt/alfresco/alfresco.sh start
I found this article helpful to create a cron job: http://grover.open2space.com/content/postgresql-84-database-backups-pg_dump-and-cron
kr
Josef

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2013 10:53 PM
Hi cibex,.. thanks for your command to create backup. but, this is step for backup.
how to step for restore after create backup step? thanks
how to step for restore after create backup step? thanks

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2013 02:11 AM
after I used the bundled Linux installer to install Community 4.2.c ib ubuntu 12.04 OS server, to install Community on different server machines
the first one I did was:
1> compress all of the directory. (/opt/alfresco-4.2.c)
2> backup database with like this:
/opt/alfresco-4.2.c/postgresql/bin/pg_dump-U alfresco alfresco | gzip > /opt / postgres_ $ (date +% Y% m% d-% H% M% S). dmp.gz
then
1> rename old directory like this (/opt/alfresco-4.2.c with /opt /alfresco_old)
2> extract it to a new server machine (/opt/alfresco-4.2.c)
3> and restore postgre database like this
/opt/alfresco-4.2.c/postgresql/bin/psql-U alfresco alfresco </opt/postgres_20130904-093544.dmp.
(note: all the processes that I did with alfresco conditions of service is not running).
However, it still does not run postgre database. sample in console :
root@dms1:~# /opt/alfresco-4.2.c/postgresql/scripts/ctl.sh status
postgresql not running
root@dms1:~# /opt/alfresco-4.2.c/postgresql/scripts/ctl.sh start
could not change directory to "/root"
waiting for server to start………………………………………………………pg_ctl.bin:
could not start server
Examine the log output.
/opt/alfresco-4.2.c/postgresql/scripts/ctl.sh : postgresql could not be started
where lies the fault?
Can you help me? is there a step by step for an easier way to backup and restore of alfresco?
many thanks and best regards.
gopei
the first one I did was:
1> compress all of the directory. (/opt/alfresco-4.2.c)
2> backup database with like this:
/opt/alfresco-4.2.c/postgresql/bin/pg_dump-U alfresco alfresco | gzip > /opt / postgres_ $ (date +% Y% m% d-% H% M% S). dmp.gz
then
1> rename old directory like this (/opt/alfresco-4.2.c with /opt /alfresco_old)
2> extract it to a new server machine (/opt/alfresco-4.2.c)
3> and restore postgre database like this
/opt/alfresco-4.2.c/postgresql/bin/psql-U alfresco alfresco </opt/postgres_20130904-093544.dmp.
(note: all the processes that I did with alfresco conditions of service is not running).
However, it still does not run postgre database. sample in console :
root@dms1:~# /opt/alfresco-4.2.c/postgresql/scripts/ctl.sh status
postgresql not running
root@dms1:~# /opt/alfresco-4.2.c/postgresql/scripts/ctl.sh start
could not change directory to "/root"
waiting for server to start………………………………………………………pg_ctl.bin:
could not start server
Examine the log output.
/opt/alfresco-4.2.c/postgresql/scripts/ctl.sh : postgresql could not be started
where lies the fault?
Can you help me? is there a step by step for an easier way to backup and restore of alfresco?
many thanks and best regards.
gopei
