⇤ ← Revision 1 as of 2009-05-26 15:09:04
1961
Comment:
|
2251
|
Deletions are marked like this. | Additions are marked like this. |
Line 71: | Line 71: |
zcat /path/to/udd.sql.gz | psql udd | $ zcat /path/to/udd.sql.gz | psql udd |
Line 75: | Line 75: |
== Reimport UDD == If we already have a UDD replicated on our local machine and want to reimport the UDD dump, we need to: {{{ $ dropdb udd $ createdb -E SQL_ASCII udd $ zcat /path/to/udd.sql.gz | psql udd }}} so simply drop the db, recreate it and import the dump again. |
Create a Local Replica of UDD
As we can see from UDD main page, there is a dump available.
So if we want to do some test, maybe a local replica of UDD can be handy, and that's what this page will describe.
Install Needed Packages
UDD runs on PostgreSql, so we need to install it (if it's not already available):
sudo apt-get install postgresql
that installs always the current supported version (at the time of writing it's 8.3).
Then we need also to install:
$ apt-cache search plperl postgresql-plperl-8.3 - PL/Perl procedural language for PostgreSQL 8.3 $ sudo apt-get install postgresql-plperl-8.3
and
$ apt-cache search debversion postgresql-8.3-debversion - Debian version number type for PostgreSQL $ sudo apt-get install postgresql-8.3-debversion
needed for packages version comparison.
Setup PostgreSql Server
Now we got an "empty" ?PostreSql db server, let's set up it a bit.
First we create some users/roles
$ sudo su postgres $ createuser morph Shall the new role be a superuser? (y/n) y
This is my user, with superuser powers to easy management, create your own.
$ createuser udd Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n
This is the UDD user on the database, where the UDD objects will live.
We need to do these configurations with the user <code>postgres</code>, the owner of the db instance.
$ createdb -E SQL_ASCII udd
We create the database, named 'udd', forcing the encoding to SQL_ASCII, since that's teh format of the export.
Import UDD Dump
Now we only need to download the dump and import it, with:
$ zcat /path/to/udd.sql.gz | psql udd
that will import the dump into udd db.
Reimport UDD
If we already have a UDD replicated on our local machine and want to reimport the UDD dump, we need to:
$ dropdb udd $ createdb -E SQL_ASCII udd $ zcat /path/to/udd.sql.gz | psql udd
so simply drop the db, recreate it and import the dump again.