How to Backup and Restore in XP.
How to Backup and Restore in XP.
Hey guys and gals. I just installed TimeTrex from the Windows installer, so it installed PostgreSQL and Apache right into the TimeTrex Program folders. How do I go about backing up and restoring the DB in case of failure? Ive never used PostgreSQL, so any info would be great.
Until we release the next version with built-in backup scripts you will need to consult the PostgreSQL manual on backup/restore.
http://www.postgresql.org/docs/8.2/inte ... ackup.html
http://www.postgresql.org/docs/8.2/inte ... ackup.html
Default DB name?
What is the default DB name? Is it "postgre", or does it default to another name during the install?
Install failed miserably
I downloaded the windows installer for rc-2. Pointed the installer to the current directory. E:\\program files\timetrex, the install looked like it completed. However on the launch to finish the install I get a "Page Cannot Be Displayed. Also. the TimeTrexApache service is failing with a error message as follows: The TimeTrexApache service failed to start with service specific error 1.
During the upgrade process the Apache service shouldn't have been modified at all. So you're going to need to check log files and figure out why its not starting.
A good place to start might be to edit the timetrex/start.bat file, and copy the command out of their and run it manually from the command prompt so you can see if any error messages appear at that time.
A good place to start might be to edit the timetrex/start.bat file, and copy the command out of their and run it manually from the command prompt so you can see if any error messages appear at that time.
I think I may have found out what is causing this. Please check your Apache conf file located in:
c:\program files\TimeTrex\apache2\conf\httpd.conf
At the very end of that file, does it contain two instances of PHPIniDir on the same line? Something like this:
If so, delete everything after the second instance of PHPIniDir including PHPIniDir itself, so it looks like this:
c:\program files\TimeTrex\apache2\conf\httpd.conf
At the very end of that file, does it contain two instances of PHPIniDir on the same line? Something like this:
Code: Select all
PHPIniDir "c:\program files\timetrex\php\"PHPIniDir "c:\program files\timetrex\php\"
If so, delete everything after the second instance of PHPIniDir including PHPIniDir itself, so it looks like this:
Code: Select all
PHPIniDir "c:\program files\timetrex\php\"
trying a test restore
Shaun, Im trying to do a test restore, but not having much luck. Ive installed TT on my workstation(XP sp2) using the Windows Installer. Im going to use this to run TT test on. I was able to do a restore using pg_dump by running the following statements from the command prompt:
1. SET PGPASSWORD="Password from your backup_database.bat"
2. SET PGDATABASE=timetrex
3. "C:\program files\timetrex/postgresql\bin\pg_dump.exe" -d -f C:\timetrexbu2.sql - h localhost -U timetrex -p 5433
However I cannot restore the DB. Here are the steps Im doing.
1. See Above
2. See above
3. "C:\program files\timetrex/postgresql\bin\psql.exe" timetrex -p 5433 < C:\timetrexbu2.sql
I get a return of Failure: password authentication failed for %username%
Can you give me the correct syntax that I should use?
Also, is it possible to restore a DB from one machine to another?
1. SET PGPASSWORD="Password from your backup_database.bat"
2. SET PGDATABASE=timetrex
3. "C:\program files\timetrex/postgresql\bin\pg_dump.exe" -d -f C:\timetrexbu2.sql - h localhost -U timetrex -p 5433
However I cannot restore the DB. Here are the steps Im doing.
1. See Above
2. See above
3. "C:\program files\timetrex/postgresql\bin\psql.exe" timetrex -p 5433 < C:\timetrexbu2.sql
I get a return of Failure: password authentication failed for %username%
Can you give me the correct syntax that I should use?
Also, is it possible to restore a DB from one machine to another?
Try using pg_restore.exe to restore the dump.
Something like this should work:
Something like this should work:
Code: Select all
"C:\program files\timetrex/postgresql\bin\pg_restore.exe" -d timetrex -h localhost -U timetrex -p 5433 C:\timetrexbu2.sql
It`s easy to backup a postgresql 8.2 DB in TT (there is a script named backup_database)shaunw wrote:We plan on adding a backup script to the installer in the next version. Until then you will need to run pg_dump manually from the PostgreSQL directory to dump the TimeTrex database.
but it is hard for me to restore the same database on another machine or after reinstalling on the same machine (there is a lack of a such kind of script)
For instance:
dumping woks with:
SET PGPASSWORD=[Password from your backup_database.bat]
SET PGDATABASE=timetrex
"D:\Program Files\TimeTrex/postgresql\bin\pg_dump.exe" -d -f timetrex_database_%date%.sql -h localhost -U timetrex -p 5433
Re: Restore?
restore doesn`t work with:bad8174 wrote:Thanks guys. Whats the restore method? Also, what file name does the pg_dump, dump to?
"C:\program files\timetrex/postgresql\bin\pg_restore.exe" -d timetrex -h localhost -U timetrex -p 5433 C:\..........\timetrex_database_18.12.2008.sql
on another machine or after reinstalling on the same machine
The answer from CP is
...The systeem cannot find the path specified
There is also another problem when installing TT on another machine or after reinstalling on the same machine: the password of the new DB before restoring the old one is different and do not match.
It`s easy to backup a postgresql 8.2 DB in TT (there is a script named backup_database)shaunw wrote:Try using pg_restore.exe to restore the dump.
Something like this should work:Code: Select all
"C:\program files\timetrex/postgresql\bin\pg_restore.exe" -d timetrex -h localhost -U timetrex -p 5433 C:\timetrexbu2.sql
but it is hard for me to restore the same database on another machine or after reinstalling on the same machine (there is a lack of a such kind of script)
For instance:
dumping woks with:
SET PGPASSWORD=[Password from your backup_database.bat]
SET PGDATABASE=timetrex
"D:\Program Files\TimeTrex/postgresql\bin\pg_dump.exe" -d -f timetrex_database_%date%.sql -h localhost -U timetrex -p 5433
but
restore doesn`t work with:
"C:\program files\timetrex/postgresql\bin\pg_restore.exe" -d timetrex -h localhost -U timetrex -p 5433 C:\..........\timetrex_database_18.12.2008.sql
on another machine or after reinstalling on the same machine
The answer from CP is
...The system cannot find the path specified
There is also another problem when installing TT on another machine or after reinstalling on the same machine: the password of the new DB before restoring the old one is different and do not match.