This is a guide for PostgreSQL databases only. |
<!-- Current --> <property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property> <property name="dialect">NHibernate.Dialect.PostgreSQL82Dialect</property> <property name="connection.connection_string">Server=127.0.0.1;Port=9001;Database=ContinuaCI;User Id=postgres;Password=dsf99EDF983245LJfsdf;MinPoolSize=10;MaxPoolSize=256</property> |
The last line contains all the information you need to connect to backup/restore the database.
The program used to dump the database is called pg_dump.exe, a copy of it comes with the ContinuaCI Server installer and can be found in the %InstallDirectory%\Server\PostgreSQL\bin, the default location is C:\Program Files\VSoft Technologies\ContinuaCI\Server\PostgreSQL\bin.
pg_dump.exe has many options, the ones we recommend are the following:
Option | |
---|---|
-h | '127.0.0.1' if you're on the same machine as the Continua database server |
-p | 9001 is the default port we use when installing Continua. |
-U | postgres is the default username when installing Continua |
-F p | This outputs the database in plain text which equates to SQL commands |
-f <backup_filename> | The full path and file name where the database backup will be written to. |
The final options is the database name which is ContinuaCI.
The final command then will look something like this:
pg_dump.exe -h localhost -p 9001 -U postgres -F p -f C:\continua_backup.bak ContinuaCI |
The pg_dump command will require a password after connecting to the postgres server. There are 3 ways to enter the password:
Make sure you've read Backing up the ContinuaCI database and Backing up the ContinuaCI database before proceeding.
When pg_dump was executed, the -F p option was given. This means the backup file contains a list of sql commands with the data requires to re-create your database. To restore this type of backup file you need to use the psql.exe command. The default location of this file is: C:\Program Files\VSoft Technologies\ContinuaCI\Server\PostgreSQL\bin.
C:\Program Files\VSoft Technologies\ContinuaCI\Server\PostgreSQL\bin>psql -h loc
alhost -p 9001 -U postgres ContinuaCI < \\Hercules\C$\PGBACKUP\PGBACKUP_06112012
1009.bak